From 6add81a967a830418b1507ac99ddba2d4e43a62b Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Fri, 8 Sep 2023 21:00:04 -0500 Subject: [PATCH] No public description PiperOrigin-RevId: 563905885 --- .github/ISSUE_TEMPLATE/00-bug-template.md | 6 +- .github/ISSUE_TEMPLATE/10-feature-request.md | 4 +- .../ISSUE_TEMPLATE/20-documentation-issue.md | 2 +- .github/workflows/format.yml | 2 +- CONTRIBUTING.md | 42 +-- ISSUE_TEMPLATE.md | 4 +- README.md | 50 +-- keras/api/BUILD | 199 ---------- keras/api/api_gen.bzl | 130 ------- keras/api/create_python_api_wrapper.py | 34 -- keras/applications/__init__.py | 64 ---- keras/benchmarks/README.md | 3 - keras/distribute/README.md | 6 - keras/layers/__init__.py | 292 --------------- keras/layers/convolutional/BUILD | 308 ---------------- keras/layers/convolutional/__init__.py | 56 --- keras/layers/core/__init__.py | 47 --- keras/layers/merging/__init__.py | 35 -- keras/layers/pooling/__init__.py | 43 --- keras/layers/reshaping/__init__.py | 29 -- keras/layers/rnn/__init__.py | 73 ---- keras/legacy_tf_layers/__init__.py | 3 - keras/metrics/__init__.py | 224 ------------ keras/models/__init__.py | 36 -- keras/opensource_only.files | 3 - keras/optimizers/schedules/BUILD | 38 -- keras/tools/pip_package/BUILD | 44 --- keras/utils/__init__.py | 74 ---- oss_setup.py | 23 +- pip_build.py | 34 +- requirements.txt | 2 +- {keras => tf_keras}/BUILD | 144 ++++---- {keras => tf_keras}/__init__.py | 12 +- {keras => tf_keras}/activations.py | 16 +- {keras => tf_keras}/activations_test.py | 14 +- tf_keras/api/BUILD | 95 +++++ tf_keras/api/api_gen.bzl | 304 ++++++++++++++++ {keras => tf_keras}/api/api_init_files.bzl | 0 tf_keras/api/extractor_wrapper.py | 20 ++ tf_keras/api/generator_wrapper.py | 20 ++ {keras => tf_keras}/api/golden/BUILD | 2 +- .../golden/v1/tensorflow.keras.-model.pbtxt | 8 +- .../v1}/tensorflow.keras.-sequential.pbtxt | 12 +- ...internal__.layers.-base-random-layer.pbtxt | 6 +- ...tensorflow.keras.__internal__.layers.pbtxt | 0 ...__.legacy.layers.-average-pooling1-d.pbtxt | 14 +- ...__.legacy.layers.-average-pooling2-d.pbtxt | 14 +- ...__.legacy.layers.-average-pooling3-d.pbtxt | 14 +- ..._.legacy.layers.-batch-normalization.pbtxt | 14 +- ....__internal__.legacy.layers.-conv1-d.pbtxt | 14 +- ...l__.legacy.layers.-conv2-d-transpose.pbtxt | 16 +- ....__internal__.legacy.layers.-conv2-d.pbtxt | 14 +- ...l__.legacy.layers.-conv3-d-transpose.pbtxt | 16 +- ....__internal__.legacy.layers.-conv3-d.pbtxt | 14 +- ...as.__internal__.legacy.layers.-dense.pbtxt | 12 +- ....__internal__.legacy.layers.-dropout.pbtxt | 14 +- ....__internal__.legacy.layers.-flatten.pbtxt | 12 +- ...internal__.legacy.layers.-input-spec.pbtxt | 2 +- ...as.__internal__.legacy.layers.-layer.pbtxt | 8 +- ...rnal__.legacy.layers.-max-pooling1-d.pbtxt | 14 +- ...rnal__.legacy.layers.-max-pooling2-d.pbtxt | 14 +- ...rnal__.legacy.layers.-max-pooling3-d.pbtxt | 14 +- ...l__.legacy.layers.-separable-conv1-d.pbtxt | 16 +- ...l__.legacy.layers.-separable-conv2-d.pbtxt | 16 +- ...nternal__.legacy.layers.experimental.pbtxt | 0 ...low.keras.__internal__.legacy.layers.pbtxt | 0 ...tensorflow.keras.__internal__.legacy.pbtxt | 0 ....legacy.rnn_cell.-basic-l-s-t-m-cell.pbtxt | 14 +- ...__.legacy.rnn_cell.-basic-r-n-n-cell.pbtxt | 14 +- ...al__.legacy.rnn_cell.-device-wrapper.pbtxt | 14 +- ...l__.legacy.rnn_cell.-dropout-wrapper.pbtxt | 14 +- ...ternal__.legacy.rnn_cell.-g-r-u-cell.pbtxt | 14 +- ...rnal__.legacy.rnn_cell.-l-s-t-m-cell.pbtxt | 14 +- ...legacy.rnn_cell.-l-s-t-m-state-tuple.pbtxt | 4 +- ...__.legacy.rnn_cell.-multi-r-n-n-cell.pbtxt | 12 +- ...ternal__.legacy.rnn_cell.-r-n-n-cell.pbtxt | 10 +- ...__.legacy.rnn_cell.-residual-wrapper.pbtxt | 14 +- ...w.keras.__internal__.legacy.rnn_cell.pbtxt | 0 .../v1/tensorflow.keras.__internal__.pbtxt | 0 .../v1/tensorflow.keras.activations.pbtxt | 0 ...nsorflow.keras.applications.convnext.pbtxt | 0 ...nsorflow.keras.applications.densenet.pbtxt | 0 ...flow.keras.applications.efficientnet.pbtxt | 0 ...w.keras.applications.efficientnet_v2.pbtxt | 0 ...ow.keras.applications.imagenet_utils.pbtxt | 0 ...ras.applications.inception_resnet_v2.pbtxt | 0 ...flow.keras.applications.inception_v3.pbtxt | 0 ...sorflow.keras.applications.mobilenet.pbtxt | 0 ...flow.keras.applications.mobilenet_v2.pbtxt | 0 ...flow.keras.applications.mobilenet_v3.pbtxt | 0 ...tensorflow.keras.applications.nasnet.pbtxt | 0 .../v1/tensorflow.keras.applications.pbtxt | 0 ...tensorflow.keras.applications.regnet.pbtxt | 0 ...tensorflow.keras.applications.resnet.pbtxt | 0 ...nsorflow.keras.applications.resnet50.pbtxt | 0 ...sorflow.keras.applications.resnet_rs.pbtxt | 0 ...sorflow.keras.applications.resnet_v2.pbtxt | 0 .../tensorflow.keras.applications.vgg16.pbtxt | 0 .../tensorflow.keras.applications.vgg19.pbtxt | 0 ...nsorflow.keras.applications.xception.pbtxt | 0 .../tensorflow.keras.backend.name_scope.pbtxt | 0 .../golden/v1/tensorflow.keras.backend.pbtxt | 0 ...sorflow.keras.callbacks.-base-logger.pbtxt | 4 +- ...orflow.keras.callbacks.-c-s-v-logger.pbtxt | 4 +- ...rflow.keras.callbacks.-callback-list.pbtxt | 2 +- ...tensorflow.keras.callbacks.-callback.pbtxt | 2 +- ...flow.keras.callbacks.-early-stopping.pbtxt | 4 +- .../tensorflow.keras.callbacks.-history.pbtxt | 4 +- ...low.keras.callbacks.-lambda-callback.pbtxt | 4 +- ...s.callbacks.-learning-rate-scheduler.pbtxt | 4 +- ...ow.keras.callbacks.-model-checkpoint.pbtxt | 4 +- ...flow.keras.callbacks.-progbar-logger.pbtxt | 4 +- ...ras.callbacks.-reduce-l-r-on-plateau.pbtxt | 4 +- ...flow.keras.callbacks.-remote-monitor.pbtxt | 4 +- ...acks.-sidecar-evaluator-model-export.pbtxt | 6 +- ...orflow.keras.callbacks.-tensor-board.pbtxt | 8 +- ...w.keras.callbacks.-terminate-on-na-n.pbtxt | 4 +- .../v1/tensorflow.keras.callbacks.pbtxt | 0 ...orflow.keras.constraints.-constraint.pbtxt | 2 +- ...nsorflow.keras.constraints.-max-norm.pbtxt | 4 +- ...flow.keras.constraints.-min-max-norm.pbtxt | 4 +- ...ensorflow.keras.constraints.-non-neg.pbtxt | 4 +- ...keras.constraints.-radial-constraint.pbtxt | 4 +- ...sorflow.keras.constraints.-unit-norm.pbtxt | 4 +- ...ensorflow.keras.constraints.max_norm.pbtxt | 4 +- ...rflow.keras.constraints.min_max_norm.pbtxt | 4 +- ...tensorflow.keras.constraints.non_neg.pbtxt | 4 +- .../v1/tensorflow.keras.constraints.pbtxt | 0 ....keras.constraints.radial_constraint.pbtxt | 4 +- ...nsorflow.keras.constraints.unit_norm.pbtxt | 4 +- ...orflow.keras.datasets.boston_housing.pbtxt | 0 .../tensorflow.keras.datasets.cifar10.pbtxt | 0 .../tensorflow.keras.datasets.cifar100.pbtxt | 0 ...sorflow.keras.datasets.fashion_mnist.pbtxt | 0 .../v1/tensorflow.keras.datasets.imdb.pbtxt | 0 .../v1/tensorflow.keras.datasets.mnist.pbtxt | 0 .../golden/v1/tensorflow.keras.datasets.pbtxt | 0 .../tensorflow.keras.datasets.reuters.pbtxt | 0 .../v1/tensorflow.keras.estimator.pbtxt | 0 ....experimental.-cosine-decay-restarts.pbtxt | 4 +- ...low.keras.experimental.-cosine-decay.pbtxt | 4 +- ...low.keras.experimental.-linear-model.pbtxt | 10 +- ...eras.experimental.-sequence-features.pbtxt | 8 +- ....keras.experimental.-wide-deep-model.pbtxt | 10 +- .../v1/tensorflow.keras.experimental.pbtxt | 0 ...sorflow.keras.export.-export-archive.pbtxt | 2 +- .../golden/v1/tensorflow.keras.export.pbtxt | 0 ...sorflow.keras.initializers.-constant.pbtxt | 0 ...sorflow.keras.initializers.-identity.pbtxt | 0 ...flow.keras.initializers.-initializer.pbtxt | 2 +- .../tensorflow.keras.initializers.-ones.pbtxt | 0 ...rflow.keras.initializers.-orthogonal.pbtxt | 0 ...ow.keras.initializers.-random-normal.pbtxt | 2 +- ...w.keras.initializers.-random-uniform.pbtxt | 2 +- ...keras.initializers.-truncated-normal.pbtxt | 2 +- ...keras.initializers.-variance-scaling.pbtxt | 0 ...tensorflow.keras.initializers.-zeros.pbtxt | 0 ...nsorflow.keras.initializers.constant.pbtxt | 0 ...low.keras.initializers.glorot_normal.pbtxt | 0 ...ow.keras.initializers.glorot_uniform.pbtxt | 0 ...sorflow.keras.initializers.he_normal.pbtxt | 2 +- ...orflow.keras.initializers.he_uniform.pbtxt | 2 +- ...nsorflow.keras.initializers.identity.pbtxt | 0 ...flow.keras.initializers.lecun_normal.pbtxt | 2 +- ...low.keras.initializers.lecun_uniform.pbtxt | 2 +- ...tensorflow.keras.initializers.normal.pbtxt | 2 +- .../tensorflow.keras.initializers.ones.pbtxt | 0 ...orflow.keras.initializers.orthogonal.pbtxt | 0 .../v1/tensorflow.keras.initializers.pbtxt | 0 ...low.keras.initializers.random_normal.pbtxt | 2 +- ...ow.keras.initializers.random_uniform.pbtxt | 2 +- ....keras.initializers.truncated_normal.pbtxt | 2 +- ...ensorflow.keras.initializers.uniform.pbtxt | 2 +- .../tensorflow.keras.initializers.zeros.pbtxt | 0 ...ow.keras.layers.-abstract-r-n-n-cell.pbtxt | 6 +- .../tensorflow.keras.layers.-activation.pbtxt | 6 +- ...eras.layers.-activity-regularization.pbtxt | 6 +- .../v1}/tensorflow.keras.layers.-add.pbtxt | 8 +- ...low.keras.layers.-additive-attention.pbtxt | 10 +- ...nsorflow.keras.layers.-alpha-dropout.pbtxt | 8 +- .../tensorflow.keras.layers.-attention.pbtxt | 10 +- ...low.keras.layers.-average-pooling1-d.pbtxt | 8 +- ...low.keras.layers.-average-pooling2-d.pbtxt | 8 +- ...low.keras.layers.-average-pooling3-d.pbtxt | 8 +- .../tensorflow.keras.layers.-average.pbtxt | 8 +- ...tensorflow.keras.layers.-avg-pool1-d.pbtxt | 8 +- ...tensorflow.keras.layers.-avg-pool2-d.pbtxt | 8 +- ...tensorflow.keras.layers.-avg-pool3-d.pbtxt | 8 +- ...ow.keras.layers.-batch-normalization.pbtxt | 8 +- ...nsorflow.keras.layers.-bidirectional.pbtxt | 8 +- ...flow.keras.layers.-category-encoding.pbtxt | 6 +- ...tensorflow.keras.layers.-center-crop.pbtxt | 6 +- ...tensorflow.keras.layers.-concatenate.pbtxt | 8 +- ...orflow.keras.layers.-conv-l-s-t-m1-d.pbtxt | 12 +- ...orflow.keras.layers.-conv-l-s-t-m2-d.pbtxt | 12 +- ...orflow.keras.layers.-conv-l-s-t-m3-d.pbtxt | 12 +- ...flow.keras.layers.-conv1-d-transpose.pbtxt | 10 +- .../v1/tensorflow.keras.layers.-conv1-d.pbtxt | 8 +- ...flow.keras.layers.-conv2-d-transpose.pbtxt | 10 +- .../tensorflow.keras.layers.-conv2-d.pbtxt | 8 +- ...flow.keras.layers.-conv3-d-transpose.pbtxt | 10 +- .../tensorflow.keras.layers.-conv3-d.pbtxt | 8 +- ...ras.layers.-convolution1-d-transpose.pbtxt | 10 +- ...sorflow.keras.layers.-convolution1-d.pbtxt | 8 +- ...ras.layers.-convolution2-d-transpose.pbtxt | 10 +- ...sorflow.keras.layers.-convolution2-d.pbtxt | 8 +- ...ras.layers.-convolution3-d-transpose.pbtxt | 10 +- ...sorflow.keras.layers.-convolution3-d.pbtxt | 8 +- ...tensorflow.keras.layers.-cropping1-d.pbtxt | 6 +- ...tensorflow.keras.layers.-cropping2-d.pbtxt | 6 +- ...tensorflow.keras.layers.-cropping3-d.pbtxt | 6 +- ...sorflow.keras.layers.-cu-d-n-n-g-r-u.pbtxt | 10 +- ...rflow.keras.layers.-cu-d-n-n-l-s-t-m.pbtxt | 10 +- ...sorflow.keras.layers.-dense-features.pbtxt | 8 +- .../v1/tensorflow.keras.layers.-dense.pbtxt | 6 +- ...flow.keras.layers.-depthwise-conv1-d.pbtxt | 10 +- ...flow.keras.layers.-depthwise-conv2-d.pbtxt | 10 +- ...sorflow.keras.layers.-discretization.pbtxt | 8 +- .../v1}/tensorflow.keras.layers.-dot.pbtxt | 8 +- .../v1/tensorflow.keras.layers.-dropout.pbtxt | 8 +- .../v1}/tensorflow.keras.layers.-e-l-u.pbtxt | 6 +- ...ensorflow.keras.layers.-einsum-dense.pbtxt | 6 +- .../tensorflow.keras.layers.-embedding.pbtxt | 6 +- .../tensorflow.keras.layers.-flatten.pbtxt | 6 +- .../tensorflow.keras.layers.-g-r-u-cell.pbtxt | 12 +- .../v1/tensorflow.keras.layers.-g-r-u.pbtxt | 8 +- ...rflow.keras.layers.-gaussian-dropout.pbtxt | 8 +- ...sorflow.keras.layers.-gaussian-noise.pbtxt | 8 +- ...as.layers.-global-average-pooling1-d.pbtxt | 8 +- ...as.layers.-global-average-pooling2-d.pbtxt | 8 +- ...as.layers.-global-average-pooling3-d.pbtxt | 8 +- ...low.keras.layers.-global-avg-pool1-d.pbtxt | 8 +- ...low.keras.layers.-global-avg-pool2-d.pbtxt | 8 +- ...low.keras.layers.-global-avg-pool3-d.pbtxt | 8 +- ...low.keras.layers.-global-max-pool1-d.pbtxt | 8 +- ...low.keras.layers.-global-max-pool2-d.pbtxt | 8 +- ...low.keras.layers.-global-max-pool3-d.pbtxt | 8 +- ....keras.layers.-global-max-pooling1-d.pbtxt | 8 +- ....keras.layers.-global-max-pooling2-d.pbtxt | 8 +- ....keras.layers.-global-max-pooling3-d.pbtxt | 8 +- .../v1/tensorflow.keras.layers.-hashing.pbtxt | 6 +- .../tensorflow.keras.layers.-identity.pbtxt | 6 +- ...tensorflow.keras.layers.-input-layer.pbtxt | 6 +- .../tensorflow.keras.layers.-input-spec.pbtxt | 2 +- ...ensorflow.keras.layers.-l-s-t-m-cell.pbtxt | 12 +- .../v1/tensorflow.keras.layers.-l-s-t-m.pbtxt | 8 +- .../v1/tensorflow.keras.layers.-lambda.pbtxt | 6 +- ...ow.keras.layers.-layer-normalization.pbtxt | 6 +- .../v1}/tensorflow.keras.layers.-layer.pbtxt | 4 +- ...ensorflow.keras.layers.-leaky-re-l-u.pbtxt | 6 +- ...w.keras.layers.-locally-connected1-d.pbtxt | 6 +- ...w.keras.layers.-locally-connected2-d.pbtxt | 6 +- .../tensorflow.keras.layers.-masking.pbtxt | 6 +- ...tensorflow.keras.layers.-max-pool1-d.pbtxt | 8 +- ...tensorflow.keras.layers.-max-pool2-d.pbtxt | 8 +- ...tensorflow.keras.layers.-max-pool3-d.pbtxt | 8 +- ...sorflow.keras.layers.-max-pooling1-d.pbtxt | 8 +- ...sorflow.keras.layers.-max-pooling2-d.pbtxt | 8 +- ...sorflow.keras.layers.-max-pooling3-d.pbtxt | 8 +- .../v1/tensorflow.keras.layers.-maximum.pbtxt | 8 +- .../tensorflow.keras.layers.-minimum.pbtxt | 8 +- ...w.keras.layers.-multi-head-attention.pbtxt | 6 +- .../tensorflow.keras.layers.-multiply.pbtxt | 8 +- ...nsorflow.keras.layers.-normalization.pbtxt | 8 +- .../tensorflow.keras.layers.-p-re-l-u.pbtxt | 6 +- .../v1/tensorflow.keras.layers.-permute.pbtxt | 6 +- .../v1/tensorflow.keras.layers.-r-n-n.pbtxt | 6 +- .../v1}/tensorflow.keras.layers.-re-l-u.pbtxt | 6 +- ...nsorflow.keras.layers.-repeat-vector.pbtxt | 6 +- .../tensorflow.keras.layers.-rescaling.pbtxt | 6 +- .../v1/tensorflow.keras.layers.-reshape.pbtxt | 6 +- .../tensorflow.keras.layers.-resizing.pbtxt | 6 +- ...flow.keras.layers.-separable-conv1-d.pbtxt | 10 +- ...flow.keras.layers.-separable-conv2-d.pbtxt | 10 +- ...ras.layers.-separable-convolution1-d.pbtxt | 10 +- ...ras.layers.-separable-convolution2-d.pbtxt | 10 +- ...flow.keras.layers.-simple-r-n-n-cell.pbtxt | 10 +- ...ensorflow.keras.layers.-simple-r-n-n.pbtxt | 8 +- .../v1/tensorflow.keras.layers.-softmax.pbtxt | 6 +- ...low.keras.layers.-spatial-dropout1-d.pbtxt | 10 +- ...low.keras.layers.-spatial-dropout2-d.pbtxt | 10 +- ...low.keras.layers.-spatial-dropout3-d.pbtxt | 10 +- ...ow.keras.layers.-stacked-r-n-n-cells.pbtxt | 6 +- .../tensorflow.keras.layers.-subtract.pbtxt | 8 +- ...low.keras.layers.-thresholded-re-l-u.pbtxt | 6 +- ...rflow.keras.layers.-time-distributed.pbtxt | 8 +- ...sorflow.keras.layers.-up-sampling1-d.pbtxt | 6 +- ...sorflow.keras.layers.-up-sampling2-d.pbtxt | 6 +- ...sorflow.keras.layers.-up-sampling3-d.pbtxt | 6 +- .../v1/tensorflow.keras.layers.-wrapper.pbtxt | 6 +- ...orflow.keras.layers.-zero-padding1-d.pbtxt | 6 +- ...orflow.keras.layers.-zero-padding2-d.pbtxt | 6 +- ...orflow.keras.layers.-zero-padding3-d.pbtxt | 6 +- ...as.layers.experimental.-einsum-dense.pbtxt | 6 +- ...xperimental.-random-fourier-features.pbtxt | 6 +- ...tensorflow.keras.layers.experimental.pbtxt | 0 ...tal.preprocessing.-category-encoding.pbtxt | 6 +- ...erimental.preprocessing.-center-crop.pbtxt | 6 +- ...mental.preprocessing.-discretization.pbtxt | 8 +- ....experimental.preprocessing.-hashing.pbtxt | 6 +- ...imental.preprocessing.-normalization.pbtxt | 8 +- ...l.preprocessing.-preprocessing-layer.pbtxt | 6 +- ...xperimental.preprocessing.-rescaling.pbtxt | 6 +- ...experimental.preprocessing.-resizing.pbtxt | 6 +- ...as.layers.experimental.preprocessing.pbtxt | 0 .../golden/v1/tensorflow.keras.layers.pbtxt | 0 ...ow.keras.losses.-binary-crossentropy.pbtxt | 6 +- ...as.losses.-binary-focal-crossentropy.pbtxt | 6 +- ...ras.losses.-categorical-crossentropy.pbtxt | 6 +- ...sses.-categorical-focal-crossentropy.pbtxt | 6 +- ...flow.keras.losses.-categorical-hinge.pbtxt | 6 +- ...flow.keras.losses.-cosine-similarity.pbtxt | 6 +- .../v1}/tensorflow.keras.losses.-hinge.pbtxt | 6 +- .../v1/tensorflow.keras.losses.-huber.pbtxt | 6 +- ...sorflow.keras.losses.-k-l-divergence.pbtxt | 6 +- .../tensorflow.keras.losses.-log-cosh.pbtxt | 6 +- .../v1/tensorflow.keras.losses.-loss.pbtxt | 2 +- ...ow.keras.losses.-mean-absolute-error.pbtxt | 6 +- ...sses.-mean-absolute-percentage-error.pbtxt | 6 +- ...low.keras.losses.-mean-squared-error.pbtxt | 6 +- ...sses.-mean-squared-logarithmic-error.pbtxt | 6 +- .../tensorflow.keras.losses.-poisson.pbtxt | 6 +- ...ses.-sparse-categorical-crossentropy.pbtxt | 6 +- ...nsorflow.keras.losses.-squared-hinge.pbtxt | 6 +- .../golden/v1/tensorflow.keras.losses.pbtxt | 0 .../v1/tensorflow.keras.metrics.-a-u-c.pbtxt | 8 +- .../tensorflow.keras.metrics.-accuracy.pbtxt | 14 +- ...rflow.keras.metrics.-binary-accuracy.pbtxt | 14 +- ...w.keras.metrics.-binary-crossentropy.pbtxt | 14 +- ...ensorflow.keras.metrics.-binary-io-u.pbtxt | 12 +- ....keras.metrics.-categorical-accuracy.pbtxt | 14 +- ...as.metrics.-categorical-crossentropy.pbtxt | 14 +- ...low.keras.metrics.-categorical-hinge.pbtxt | 14 +- ...low.keras.metrics.-cosine-similarity.pbtxt | 14 +- ...nsorflow.keras.metrics.-f-beta-score.pbtxt | 8 +- .../tensorflow.keras.metrics.-f1-score.pbtxt | 10 +- ...rflow.keras.metrics.-false-negatives.pbtxt | 10 +- ...rflow.keras.metrics.-false-positives.pbtxt | 10 +- .../v1}/tensorflow.keras.metrics.-hinge.pbtxt | 14 +- .../v1/tensorflow.keras.metrics.-io-u.pbtxt | 10 +- ...orflow.keras.metrics.-k-l-divergence.pbtxt | 14 +- ...orflow.keras.metrics.-log-cosh-error.pbtxt | 14 +- ...w.keras.metrics.-mean-absolute-error.pbtxt | 14 +- ...rics.-mean-absolute-percentage-error.pbtxt | 14 +- .../tensorflow.keras.metrics.-mean-io-u.pbtxt | 12 +- ...w.keras.metrics.-mean-metric-wrapper.pbtxt | 12 +- ...w.keras.metrics.-mean-relative-error.pbtxt | 12 +- ...ow.keras.metrics.-mean-squared-error.pbtxt | 14 +- ...rics.-mean-squared-logarithmic-error.pbtxt | 14 +- ...ensorflow.keras.metrics.-mean-tensor.pbtxt | 8 +- .../v1}/tensorflow.keras.metrics.-mean.pbtxt | 10 +- .../tensorflow.keras.metrics.-metric.pbtxt | 6 +- ...nsorflow.keras.metrics.-one-hot-io-u.pbtxt | 12 +- ...low.keras.metrics.-one-hot-mean-io-u.pbtxt | 14 +- .../tensorflow.keras.metrics.-poisson.pbtxt | 14 +- ...w.keras.metrics.-precision-at-recall.pbtxt | 10 +- .../tensorflow.keras.metrics.-precision.pbtxt | 8 +- .../tensorflow.keras.metrics.-r2-score.pbtxt | 8 +- ...w.keras.metrics.-recall-at-precision.pbtxt | 10 +- .../v1/tensorflow.keras.metrics.-recall.pbtxt | 8 +- ...ras.metrics.-root-mean-squared-error.pbtxt | 12 +- ....metrics.-sensitivity-at-specificity.pbtxt | 10 +- ...metrics.-sparse-categorical-accuracy.pbtxt | 14 +- ...ics.-sparse-categorical-crossentropy.pbtxt | 14 +- ...s.-sparse-top-k-categorical-accuracy.pbtxt | 14 +- ....metrics.-specificity-at-sensitivity.pbtxt | 10 +- ...sorflow.keras.metrics.-squared-hinge.pbtxt | 14 +- .../v1/tensorflow.keras.metrics.-sum.pbtxt | 10 +- ....metrics.-top-k-categorical-accuracy.pbtxt | 14 +- ...orflow.keras.metrics.-true-negatives.pbtxt | 10 +- ...orflow.keras.metrics.-true-positives.pbtxt | 10 +- .../golden/v1/tensorflow.keras.metrics.pbtxt | 0 ...ixed_precision.-loss-scale-optimizer.pbtxt | 2 +- .../v1/tensorflow.keras.mixed_precision.pbtxt | 2 +- ...ensorflow.keras.models.-linear-model.pbtxt | 10 +- .../v1}/tensorflow.keras.models.-model.pbtxt | 8 +- .../tensorflow.keras.models.-sequential.pbtxt | 12 +- ...orflow.keras.models.-wide-deep-model.pbtxt | 10 +- .../golden/v1/tensorflow.keras.models.pbtxt | 0 ...ensorflow.keras.optimizers.-adadelta.pbtxt | 4 +- ...tensorflow.keras.optimizers.-adagrad.pbtxt | 4 +- .../tensorflow.keras.optimizers.-adam.pbtxt | 4 +- .../tensorflow.keras.optimizers.-adamax.pbtxt | 4 +- .../tensorflow.keras.optimizers.-ftrl.pbtxt | 4 +- .../tensorflow.keras.optimizers.-nadam.pbtxt | 4 +- ...nsorflow.keras.optimizers.-optimizer.pbtxt | 2 +- ...nsorflow.keras.optimizers.-r-m-sprop.pbtxt | 4 +- .../tensorflow.keras.optimizers.-s-g-d.pbtxt | 4 +- ...ow.keras.optimizers.legacy.-adadelta.pbtxt | 4 +- ...low.keras.optimizers.legacy.-adagrad.pbtxt | 4 +- ...orflow.keras.optimizers.legacy.-adam.pbtxt | 4 +- ...flow.keras.optimizers.legacy.-adamax.pbtxt | 4 +- ...orflow.keras.optimizers.legacy.-ftrl.pbtxt | 4 +- ...rflow.keras.optimizers.legacy.-nadam.pbtxt | 4 +- ...w.keras.optimizers.legacy.-optimizer.pbtxt | 2 +- ...w.keras.optimizers.legacy.-r-m-sprop.pbtxt | 4 +- ...rflow.keras.optimizers.legacy.-s-g-d.pbtxt | 4 +- .../tensorflow.keras.optimizers.legacy.pbtxt | 0 .../v1/tensorflow.keras.optimizers.pbtxt | 0 ...ers.schedules.-cosine-decay-restarts.pbtxt | 4 +- ...s.optimizers.schedules.-cosine-decay.pbtxt | 4 +- ...imizers.schedules.-exponential-decay.pbtxt | 4 +- ...mizers.schedules.-inverse-time-decay.pbtxt | 4 +- ...rs.schedules.-learning-rate-schedule.pbtxt | 2 +- ....schedules.-piecewise-constant-decay.pbtxt | 4 +- ...timizers.schedules.-polynomial-decay.pbtxt | 4 +- ...ensorflow.keras.optimizers.schedules.pbtxt | 0 .../api/golden/v1/tensorflow.keras.pbtxt | 0 ...processing.image.-directory-iterator.pbtxt | 8 +- ...ocessing.image.-image-data-generator.pbtxt | 2 +- ....keras.preprocessing.image.-iterator.pbtxt | 4 +- ...ocessing.image.-numpy-array-iterator.pbtxt | 6 +- ...tensorflow.keras.preprocessing.image.pbtxt | 0 .../v1/tensorflow.keras.preprocessing.pbtxt | 0 ...ssing.sequence.-timeseries-generator.pbtxt | 4 +- ...sorflow.keras.preprocessing.sequence.pbtxt | 0 ....keras.preprocessing.text.-tokenizer.pbtxt | 2 +- .../tensorflow.keras.preprocessing.text.pbtxt | 0 ...tensorflow.keras.regularizers.-l1-l2.pbtxt | 4 +- .../tensorflow.keras.regularizers.-l1.pbtxt | 4 +- .../tensorflow.keras.regularizers.-l2.pbtxt | 4 +- ...flow.keras.regularizers.-regularizer.pbtxt | 2 +- .../v1/tensorflow.keras.regularizers.l1.pbtxt | 4 +- .../tensorflow.keras.regularizers.l2.pbtxt | 4 +- .../v1/tensorflow.keras.regularizers.pbtxt | 0 ...low.keras.saving.custom_object_scope.pbtxt | 2 +- .../golden/v1/tensorflow.keras.saving.pbtxt | 0 ...low.keras.utils.-custom-object-scope.pbtxt | 2 +- ...tils.-deterministic-random-test-tool.pbtxt | 2 +- ...flow.keras.utils.-generator-enqueuer.pbtxt | 4 +- ...orflow.keras.utils.-ordered-enqueuer.pbtxt | 4 +- .../v1/tensorflow.keras.utils.-progbar.pbtxt | 2 +- ...rflow.keras.utils.-sequence-enqueuer.pbtxt | 2 +- .../tensorflow.keras.utils.-sequence.pbtxt | 2 +- ...ras.utils.-steps-per-execution-tuner.pbtxt | 2 +- ...flow.keras.utils.custom_object_scope.pbtxt | 2 +- .../v1/tensorflow.keras.utils.legacy.pbtxt | 0 .../golden/v1/tensorflow.keras.utils.pbtxt | 0 .../golden/v2/tensorflow.keras.-model.pbtxt | 8 +- .../v2}/tensorflow.keras.-sequential.pbtxt | 12 +- ...low.keras.__internal__.-keras-tensor.pbtxt | 2 +- ...as.__internal__.-ragged-keras-tensor.pbtxt | 4 +- ...as.__internal__.-sparse-keras-tensor.pbtxt | 4 +- ...ensorflow.keras.__internal__.backend.pbtxt | 0 ...ernal__.layers.-base-dense-attention.pbtxt | 8 +- ...internal__.layers.-base-random-layer.pbtxt | 6 +- ...tensorflow.keras.__internal__.layers.pbtxt | 0 ...rnal__.losses.-loss-function-wrapper.pbtxt | 4 +- ...tensorflow.keras.__internal__.losses.pbtxt | 0 ...tensorflow.keras.__internal__.models.pbtxt | 0 ...orflow.keras.__internal__.optimizers.pbtxt | 0 .../v2/tensorflow.keras.__internal__.pbtxt | 0 .../tensorflow.keras.__internal__.utils.pbtxt | 0 .../v2/tensorflow.keras.activations.pbtxt | 0 ...nsorflow.keras.applications.convnext.pbtxt | 0 ...nsorflow.keras.applications.densenet.pbtxt | 0 ...flow.keras.applications.efficientnet.pbtxt | 0 ...w.keras.applications.efficientnet_v2.pbtxt | 0 ...ow.keras.applications.imagenet_utils.pbtxt | 0 ...ras.applications.inception_resnet_v2.pbtxt | 0 ...flow.keras.applications.inception_v3.pbtxt | 0 ...sorflow.keras.applications.mobilenet.pbtxt | 0 ...flow.keras.applications.mobilenet_v2.pbtxt | 0 ...flow.keras.applications.mobilenet_v3.pbtxt | 0 ...tensorflow.keras.applications.nasnet.pbtxt | 0 .../v2/tensorflow.keras.applications.pbtxt | 0 ...tensorflow.keras.applications.regnet.pbtxt | 0 ...tensorflow.keras.applications.resnet.pbtxt | 0 ...nsorflow.keras.applications.resnet50.pbtxt | 0 ...sorflow.keras.applications.resnet_rs.pbtxt | 0 ...sorflow.keras.applications.resnet_v2.pbtxt | 0 .../tensorflow.keras.applications.vgg16.pbtxt | 0 .../tensorflow.keras.applications.vgg19.pbtxt | 0 ...nsorflow.keras.applications.xception.pbtxt | 0 ...ensorflow.keras.backend.experimental.pbtxt | 0 .../golden/v2/tensorflow.keras.backend.pbtxt | 0 ....keras.callbacks.-backup-and-restore.pbtxt | 4 +- ...sorflow.keras.callbacks.-base-logger.pbtxt | 4 +- ...orflow.keras.callbacks.-c-s-v-logger.pbtxt | 4 +- ...rflow.keras.callbacks.-callback-list.pbtxt | 2 +- ...tensorflow.keras.callbacks.-callback.pbtxt | 2 +- ...flow.keras.callbacks.-early-stopping.pbtxt | 4 +- .../tensorflow.keras.callbacks.-history.pbtxt | 4 +- ...low.keras.callbacks.-lambda-callback.pbtxt | 4 +- ...s.callbacks.-learning-rate-scheduler.pbtxt | 4 +- ...ow.keras.callbacks.-model-checkpoint.pbtxt | 4 +- ...flow.keras.callbacks.-progbar-logger.pbtxt | 4 +- ...ras.callbacks.-reduce-l-r-on-plateau.pbtxt | 4 +- ...flow.keras.callbacks.-remote-monitor.pbtxt | 4 +- ...acks.-sidecar-evaluator-model-export.pbtxt | 6 +- ...orflow.keras.callbacks.-tensor-board.pbtxt | 6 +- ...w.keras.callbacks.-terminate-on-na-n.pbtxt | 4 +- ...cks.experimental.-backup-and-restore.pbtxt | 6 +- ...sorflow.keras.callbacks.experimental.pbtxt | 0 .../v2/tensorflow.keras.callbacks.pbtxt | 0 ...orflow.keras.constraints.-constraint.pbtxt | 2 +- ...nsorflow.keras.constraints.-max-norm.pbtxt | 4 +- ...flow.keras.constraints.-min-max-norm.pbtxt | 4 +- ...ensorflow.keras.constraints.-non-neg.pbtxt | 4 +- ...keras.constraints.-radial-constraint.pbtxt | 4 +- ...sorflow.keras.constraints.-unit-norm.pbtxt | 4 +- ...ensorflow.keras.constraints.max_norm.pbtxt | 4 +- ...rflow.keras.constraints.min_max_norm.pbtxt | 4 +- ...tensorflow.keras.constraints.non_neg.pbtxt | 4 +- .../v2/tensorflow.keras.constraints.pbtxt | 0 ....keras.constraints.radial_constraint.pbtxt | 4 +- ...nsorflow.keras.constraints.unit_norm.pbtxt | 4 +- ...orflow.keras.datasets.boston_housing.pbtxt | 0 .../tensorflow.keras.datasets.cifar10.pbtxt | 0 .../tensorflow.keras.datasets.cifar100.pbtxt | 0 ...sorflow.keras.datasets.fashion_mnist.pbtxt | 0 .../v2/tensorflow.keras.datasets.imdb.pbtxt | 0 .../v2/tensorflow.keras.datasets.mnist.pbtxt | 0 .../golden/v2/tensorflow.keras.datasets.pbtxt | 0 .../tensorflow.keras.datasets.reuters.pbtxt | 0 ...ras.dtensor.experimental.-layout-map.pbtxt | 2 +- ...or.experimental.optimizers.-adadelta.pbtxt | 6 +- ...sor.experimental.optimizers.-adagrad.pbtxt | 6 +- ...nsor.experimental.optimizers.-adam-w.pbtxt | 6 +- ...tensor.experimental.optimizers.-adam.pbtxt | 6 +- ...r.experimental.optimizers.-r-m-sprop.pbtxt | 6 +- ...ensor.experimental.optimizers.-s-g-d.pbtxt | 6 +- ...eras.dtensor.experimental.optimizers.pbtxt | 0 ...ensorflow.keras.dtensor.experimental.pbtxt | 0 .../golden/v2/tensorflow.keras.dtensor.pbtxt | 0 .../v2/tensorflow.keras.estimator.pbtxt | 0 ....experimental.-cosine-decay-restarts.pbtxt | 4 +- ...low.keras.experimental.-cosine-decay.pbtxt | 4 +- ...low.keras.experimental.-linear-model.pbtxt | 10 +- ...eras.experimental.-sequence-features.pbtxt | 8 +- ...eras.experimental.-sidecar-evaluator.pbtxt | 4 +- ....keras.experimental.-wide-deep-model.pbtxt | 10 +- .../v2/tensorflow.keras.experimental.pbtxt | 0 ...sorflow.keras.export.-export-archive.pbtxt | 2 +- .../golden/v2/tensorflow.keras.export.pbtxt | 0 .../golden/v2/tensorflow.keras.google.pbtxt | 0 ...sorflow.keras.initializers.-constant.pbtxt | 4 +- ...ow.keras.initializers.-glorot-normal.pbtxt | 6 +- ...w.keras.initializers.-glorot-uniform.pbtxt | 6 +- ...orflow.keras.initializers.-he-normal.pbtxt | 6 +- ...rflow.keras.initializers.-he-uniform.pbtxt | 6 +- ...sorflow.keras.initializers.-identity.pbtxt | 4 +- ...flow.keras.initializers.-initializer.pbtxt | 2 +- ...low.keras.initializers.-lecun-normal.pbtxt | 6 +- ...ow.keras.initializers.-lecun-uniform.pbtxt | 6 +- .../tensorflow.keras.initializers.-ones.pbtxt | 4 +- ...rflow.keras.initializers.-orthogonal.pbtxt | 4 +- ...ow.keras.initializers.-random-normal.pbtxt | 4 +- ...w.keras.initializers.-random-uniform.pbtxt | 4 +- ...keras.initializers.-truncated-normal.pbtxt | 4 +- ...keras.initializers.-variance-scaling.pbtxt | 4 +- ...tensorflow.keras.initializers.-zeros.pbtxt | 4 +- ...nsorflow.keras.initializers.constant.pbtxt | 4 +- ...low.keras.initializers.glorot_normal.pbtxt | 6 +- ...ow.keras.initializers.glorot_uniform.pbtxt | 6 +- ...sorflow.keras.initializers.he_normal.pbtxt | 6 +- ...orflow.keras.initializers.he_uniform.pbtxt | 6 +- ...nsorflow.keras.initializers.identity.pbtxt | 4 +- ...flow.keras.initializers.lecun_normal.pbtxt | 6 +- ...low.keras.initializers.lecun_uniform.pbtxt | 6 +- .../tensorflow.keras.initializers.ones.pbtxt | 4 +- ...orflow.keras.initializers.orthogonal.pbtxt | 4 +- .../v2/tensorflow.keras.initializers.pbtxt | 0 ...low.keras.initializers.random_normal.pbtxt | 4 +- ...ow.keras.initializers.random_uniform.pbtxt | 4 +- ....keras.initializers.truncated_normal.pbtxt | 4 +- ....keras.initializers.variance_scaling.pbtxt | 4 +- .../tensorflow.keras.initializers.zeros.pbtxt | 4 +- ...ow.keras.layers.-abstract-r-n-n-cell.pbtxt | 6 +- .../tensorflow.keras.layers.-activation.pbtxt | 6 +- ...eras.layers.-activity-regularization.pbtxt | 6 +- .../v2}/tensorflow.keras.layers.-add.pbtxt | 8 +- ...low.keras.layers.-additive-attention.pbtxt | 10 +- ...nsorflow.keras.layers.-alpha-dropout.pbtxt | 8 +- .../tensorflow.keras.layers.-attention.pbtxt | 10 +- ...low.keras.layers.-average-pooling1-d.pbtxt | 8 +- ...low.keras.layers.-average-pooling2-d.pbtxt | 8 +- ...low.keras.layers.-average-pooling3-d.pbtxt | 8 +- .../tensorflow.keras.layers.-average.pbtxt | 8 +- ...tensorflow.keras.layers.-avg-pool1-d.pbtxt | 8 +- ...tensorflow.keras.layers.-avg-pool2-d.pbtxt | 8 +- ...tensorflow.keras.layers.-avg-pool3-d.pbtxt | 8 +- ...ow.keras.layers.-batch-normalization.pbtxt | 8 +- ...nsorflow.keras.layers.-bidirectional.pbtxt | 8 +- ...flow.keras.layers.-category-encoding.pbtxt | 6 +- ...tensorflow.keras.layers.-center-crop.pbtxt | 6 +- ...tensorflow.keras.layers.-concatenate.pbtxt | 8 +- ...orflow.keras.layers.-conv-l-s-t-m1-d.pbtxt | 12 +- ...orflow.keras.layers.-conv-l-s-t-m2-d.pbtxt | 12 +- ...orflow.keras.layers.-conv-l-s-t-m3-d.pbtxt | 12 +- ...flow.keras.layers.-conv1-d-transpose.pbtxt | 10 +- .../v2/tensorflow.keras.layers.-conv1-d.pbtxt | 8 +- ...flow.keras.layers.-conv2-d-transpose.pbtxt | 10 +- .../tensorflow.keras.layers.-conv2-d.pbtxt | 8 +- ...flow.keras.layers.-conv3-d-transpose.pbtxt | 10 +- .../tensorflow.keras.layers.-conv3-d.pbtxt | 8 +- ...ras.layers.-convolution1-d-transpose.pbtxt | 10 +- ...sorflow.keras.layers.-convolution1-d.pbtxt | 8 +- ...ras.layers.-convolution2-d-transpose.pbtxt | 10 +- ...sorflow.keras.layers.-convolution2-d.pbtxt | 8 +- ...ras.layers.-convolution3-d-transpose.pbtxt | 10 +- ...sorflow.keras.layers.-convolution3-d.pbtxt | 8 +- ...tensorflow.keras.layers.-cropping1-d.pbtxt | 6 +- ...tensorflow.keras.layers.-cropping2-d.pbtxt | 6 +- ...tensorflow.keras.layers.-cropping3-d.pbtxt | 6 +- ...sorflow.keras.layers.-dense-features.pbtxt | 10 +- .../v2/tensorflow.keras.layers.-dense.pbtxt | 6 +- ...flow.keras.layers.-depthwise-conv1-d.pbtxt | 10 +- ...flow.keras.layers.-depthwise-conv2-d.pbtxt | 10 +- ...sorflow.keras.layers.-discretization.pbtxt | 8 +- .../v2}/tensorflow.keras.layers.-dot.pbtxt | 8 +- .../v2/tensorflow.keras.layers.-dropout.pbtxt | 8 +- .../v2}/tensorflow.keras.layers.-e-l-u.pbtxt | 6 +- ...ensorflow.keras.layers.-einsum-dense.pbtxt | 6 +- .../tensorflow.keras.layers.-embedding.pbtxt | 6 +- .../tensorflow.keras.layers.-flatten.pbtxt | 6 +- .../tensorflow.keras.layers.-g-r-u-cell.pbtxt | 10 +- .../v2/tensorflow.keras.layers.-g-r-u.pbtxt | 12 +- ...rflow.keras.layers.-gaussian-dropout.pbtxt | 8 +- ...sorflow.keras.layers.-gaussian-noise.pbtxt | 8 +- ...as.layers.-global-average-pooling1-d.pbtxt | 8 +- ...as.layers.-global-average-pooling2-d.pbtxt | 8 +- ...as.layers.-global-average-pooling3-d.pbtxt | 8 +- ...low.keras.layers.-global-avg-pool1-d.pbtxt | 8 +- ...low.keras.layers.-global-avg-pool2-d.pbtxt | 8 +- ...low.keras.layers.-global-avg-pool3-d.pbtxt | 8 +- ...low.keras.layers.-global-max-pool1-d.pbtxt | 8 +- ...low.keras.layers.-global-max-pool2-d.pbtxt | 8 +- ...low.keras.layers.-global-max-pool3-d.pbtxt | 8 +- ....keras.layers.-global-max-pooling1-d.pbtxt | 8 +- ....keras.layers.-global-max-pooling2-d.pbtxt | 8 +- ....keras.layers.-global-max-pooling3-d.pbtxt | 8 +- ...ow.keras.layers.-group-normalization.pbtxt | 6 +- ...orflow.keras.layers.-hashed-crossing.pbtxt | 6 +- .../v2/tensorflow.keras.layers.-hashing.pbtxt | 6 +- .../tensorflow.keras.layers.-identity.pbtxt | 6 +- ...tensorflow.keras.layers.-input-layer.pbtxt | 6 +- .../tensorflow.keras.layers.-input-spec.pbtxt | 2 +- ...sorflow.keras.layers.-integer-lookup.pbtxt | 10 +- ...ensorflow.keras.layers.-l-s-t-m-cell.pbtxt | 10 +- .../v2/tensorflow.keras.layers.-l-s-t-m.pbtxt | 12 +- .../v2/tensorflow.keras.layers.-lambda.pbtxt | 6 +- ...ow.keras.layers.-layer-normalization.pbtxt | 6 +- .../v2}/tensorflow.keras.layers.-layer.pbtxt | 4 +- ...ensorflow.keras.layers.-leaky-re-l-u.pbtxt | 6 +- ...w.keras.layers.-locally-connected1-d.pbtxt | 6 +- ...w.keras.layers.-locally-connected2-d.pbtxt | 6 +- .../tensorflow.keras.layers.-masking.pbtxt | 6 +- ...tensorflow.keras.layers.-max-pool1-d.pbtxt | 8 +- ...tensorflow.keras.layers.-max-pool2-d.pbtxt | 8 +- ...tensorflow.keras.layers.-max-pool3-d.pbtxt | 8 +- ...sorflow.keras.layers.-max-pooling1-d.pbtxt | 8 +- ...sorflow.keras.layers.-max-pooling2-d.pbtxt | 8 +- ...sorflow.keras.layers.-max-pooling3-d.pbtxt | 8 +- .../v2/tensorflow.keras.layers.-maximum.pbtxt | 8 +- .../tensorflow.keras.layers.-minimum.pbtxt | 8 +- ...w.keras.layers.-multi-head-attention.pbtxt | 6 +- .../tensorflow.keras.layers.-multiply.pbtxt | 8 +- ...nsorflow.keras.layers.-normalization.pbtxt | 8 +- .../tensorflow.keras.layers.-p-re-l-u.pbtxt | 6 +- .../v2/tensorflow.keras.layers.-permute.pbtxt | 6 +- .../v2/tensorflow.keras.layers.-r-n-n.pbtxt | 6 +- ...flow.keras.layers.-random-brightness.pbtxt | 8 +- ...orflow.keras.layers.-random-contrast.pbtxt | 8 +- ...tensorflow.keras.layers.-random-crop.pbtxt | 8 +- ...tensorflow.keras.layers.-random-flip.pbtxt | 8 +- ...nsorflow.keras.layers.-random-height.pbtxt | 8 +- ...orflow.keras.layers.-random-rotation.pbtxt | 8 +- ...low.keras.layers.-random-translation.pbtxt | 8 +- ...ensorflow.keras.layers.-random-width.pbtxt | 8 +- ...tensorflow.keras.layers.-random-zoom.pbtxt | 8 +- .../v2}/tensorflow.keras.layers.-re-l-u.pbtxt | 6 +- ...nsorflow.keras.layers.-repeat-vector.pbtxt | 6 +- .../tensorflow.keras.layers.-rescaling.pbtxt | 6 +- .../v2/tensorflow.keras.layers.-reshape.pbtxt | 6 +- .../tensorflow.keras.layers.-resizing.pbtxt | 6 +- ...flow.keras.layers.-separable-conv1-d.pbtxt | 10 +- ...flow.keras.layers.-separable-conv2-d.pbtxt | 10 +- ...ras.layers.-separable-convolution1-d.pbtxt | 10 +- ...ras.layers.-separable-convolution2-d.pbtxt | 10 +- ...flow.keras.layers.-simple-r-n-n-cell.pbtxt | 10 +- ...ensorflow.keras.layers.-simple-r-n-n.pbtxt | 8 +- .../v2/tensorflow.keras.layers.-softmax.pbtxt | 6 +- ...low.keras.layers.-spatial-dropout1-d.pbtxt | 10 +- ...low.keras.layers.-spatial-dropout2-d.pbtxt | 10 +- ...low.keras.layers.-spatial-dropout3-d.pbtxt | 10 +- ...keras.layers.-spectral-normalization.pbtxt | 8 +- ...ow.keras.layers.-stacked-r-n-n-cells.pbtxt | 6 +- ...nsorflow.keras.layers.-string-lookup.pbtxt | 10 +- .../tensorflow.keras.layers.-subtract.pbtxt | 8 +- ...low.keras.layers.-text-vectorization.pbtxt | 8 +- ...low.keras.layers.-thresholded-re-l-u.pbtxt | 6 +- ...rflow.keras.layers.-time-distributed.pbtxt | 8 +- ...low.keras.layers.-unit-normalization.pbtxt | 6 +- ...sorflow.keras.layers.-up-sampling1-d.pbtxt | 6 +- ...sorflow.keras.layers.-up-sampling2-d.pbtxt | 6 +- ...sorflow.keras.layers.-up-sampling3-d.pbtxt | 6 +- .../v2/tensorflow.keras.layers.-wrapper.pbtxt | 6 +- ...orflow.keras.layers.-zero-padding1-d.pbtxt | 6 +- ...orflow.keras.layers.-zero-padding2-d.pbtxt | 6 +- ...orflow.keras.layers.-zero-padding3-d.pbtxt | 6 +- ...as.layers.experimental.-einsum-dense.pbtxt | 6 +- ...xperimental.-random-fourier-features.pbtxt | 6 +- ...perimental.-sync-batch-normalization.pbtxt | 8 +- ...tensorflow.keras.layers.experimental.pbtxt | 0 ...tal.preprocessing.-category-encoding.pbtxt | 6 +- ...erimental.preprocessing.-center-crop.pbtxt | 6 +- ...mental.preprocessing.-discretization.pbtxt | 8 +- ...ental.preprocessing.-hashed-crossing.pbtxt | 6 +- ....experimental.preprocessing.-hashing.pbtxt | 6 +- ...mental.preprocessing.-integer-lookup.pbtxt | 10 +- ...imental.preprocessing.-normalization.pbtxt | 8 +- ...l.preprocessing.-preprocessing-layer.pbtxt | 6 +- ...ental.preprocessing.-random-contrast.pbtxt | 8 +- ...erimental.preprocessing.-random-crop.pbtxt | 8 +- ...erimental.preprocessing.-random-flip.pbtxt | 8 +- ...imental.preprocessing.-random-height.pbtxt | 8 +- ...ental.preprocessing.-random-rotation.pbtxt | 8 +- ...al.preprocessing.-random-translation.pbtxt | 8 +- ...rimental.preprocessing.-random-width.pbtxt | 8 +- ...erimental.preprocessing.-random-zoom.pbtxt | 8 +- ...xperimental.preprocessing.-rescaling.pbtxt | 6 +- ...experimental.preprocessing.-resizing.pbtxt | 6 +- ...imental.preprocessing.-string-lookup.pbtxt | 10 +- ...al.preprocessing.-text-vectorization.pbtxt | 8 +- ...as.layers.experimental.preprocessing.pbtxt | 0 .../golden/v2/tensorflow.keras.layers.pbtxt | 0 ...ow.keras.losses.-binary-crossentropy.pbtxt | 6 +- ...as.losses.-binary-focal-crossentropy.pbtxt | 6 +- ...ras.losses.-categorical-crossentropy.pbtxt | 6 +- ...sses.-categorical-focal-crossentropy.pbtxt | 6 +- ...flow.keras.losses.-categorical-hinge.pbtxt | 6 +- ...flow.keras.losses.-cosine-similarity.pbtxt | 6 +- .../v2}/tensorflow.keras.losses.-hinge.pbtxt | 6 +- .../v2/tensorflow.keras.losses.-huber.pbtxt | 6 +- ...sorflow.keras.losses.-k-l-divergence.pbtxt | 6 +- .../tensorflow.keras.losses.-log-cosh.pbtxt | 6 +- .../v2/tensorflow.keras.losses.-loss.pbtxt | 2 +- ...ow.keras.losses.-mean-absolute-error.pbtxt | 6 +- ...sses.-mean-absolute-percentage-error.pbtxt | 6 +- ...low.keras.losses.-mean-squared-error.pbtxt | 6 +- ...sses.-mean-squared-logarithmic-error.pbtxt | 6 +- .../tensorflow.keras.losses.-poisson.pbtxt | 6 +- .../tensorflow.keras.losses.-reduction.pbtxt | 2 +- ...ses.-sparse-categorical-crossentropy.pbtxt | 6 +- ...nsorflow.keras.losses.-squared-hinge.pbtxt | 6 +- .../golden/v2/tensorflow.keras.losses.pbtxt | 0 .../v2/tensorflow.keras.metrics.-a-u-c.pbtxt | 8 +- .../tensorflow.keras.metrics.-accuracy.pbtxt | 14 +- ...rflow.keras.metrics.-binary-accuracy.pbtxt | 14 +- ...w.keras.metrics.-binary-crossentropy.pbtxt | 14 +- ...ensorflow.keras.metrics.-binary-io-u.pbtxt | 12 +- ....keras.metrics.-categorical-accuracy.pbtxt | 14 +- ...as.metrics.-categorical-crossentropy.pbtxt | 14 +- ...low.keras.metrics.-categorical-hinge.pbtxt | 14 +- ...low.keras.metrics.-cosine-similarity.pbtxt | 14 +- ...nsorflow.keras.metrics.-f-beta-score.pbtxt | 8 +- .../tensorflow.keras.metrics.-f1-score.pbtxt | 10 +- ...rflow.keras.metrics.-false-negatives.pbtxt | 10 +- ...rflow.keras.metrics.-false-positives.pbtxt | 10 +- .../v2}/tensorflow.keras.metrics.-hinge.pbtxt | 14 +- .../v2/tensorflow.keras.metrics.-io-u.pbtxt | 10 +- ...orflow.keras.metrics.-k-l-divergence.pbtxt | 14 +- ...orflow.keras.metrics.-log-cosh-error.pbtxt | 14 +- ...w.keras.metrics.-mean-absolute-error.pbtxt | 14 +- ...rics.-mean-absolute-percentage-error.pbtxt | 14 +- .../tensorflow.keras.metrics.-mean-io-u.pbtxt | 12 +- ...w.keras.metrics.-mean-metric-wrapper.pbtxt | 12 +- ...w.keras.metrics.-mean-relative-error.pbtxt | 12 +- ...ow.keras.metrics.-mean-squared-error.pbtxt | 14 +- ...rics.-mean-squared-logarithmic-error.pbtxt | 14 +- ...ensorflow.keras.metrics.-mean-tensor.pbtxt | 8 +- .../v2}/tensorflow.keras.metrics.-mean.pbtxt | 10 +- .../tensorflow.keras.metrics.-metric.pbtxt | 6 +- ...nsorflow.keras.metrics.-one-hot-io-u.pbtxt | 12 +- ...low.keras.metrics.-one-hot-mean-io-u.pbtxt | 14 +- .../tensorflow.keras.metrics.-poisson.pbtxt | 14 +- ...w.keras.metrics.-precision-at-recall.pbtxt | 10 +- .../tensorflow.keras.metrics.-precision.pbtxt | 8 +- .../tensorflow.keras.metrics.-r2-score.pbtxt | 8 +- ...w.keras.metrics.-recall-at-precision.pbtxt | 10 +- .../v2/tensorflow.keras.metrics.-recall.pbtxt | 8 +- ...ras.metrics.-root-mean-squared-error.pbtxt | 12 +- ....metrics.-sensitivity-at-specificity.pbtxt | 10 +- ...metrics.-sparse-categorical-accuracy.pbtxt | 14 +- ...ics.-sparse-categorical-crossentropy.pbtxt | 14 +- ...s.-sparse-top-k-categorical-accuracy.pbtxt | 14 +- ....metrics.-specificity-at-sensitivity.pbtxt | 10 +- ...sorflow.keras.metrics.-squared-hinge.pbtxt | 14 +- .../v2/tensorflow.keras.metrics.-sum.pbtxt | 10 +- ....metrics.-top-k-categorical-accuracy.pbtxt | 14 +- ...orflow.keras.metrics.-true-negatives.pbtxt | 10 +- ...orflow.keras.metrics.-true-positives.pbtxt | 10 +- ...eras.metrics.experimental.-py-metric.pbtxt | 8 +- ...ensorflow.keras.metrics.experimental.pbtxt | 0 .../golden/v2/tensorflow.keras.metrics.pbtxt | 0 ...ixed_precision.-loss-scale-optimizer.pbtxt | 2 +- ...orflow.keras.mixed_precision.-policy.pbtxt | 2 +- .../v2/tensorflow.keras.mixed_precision.pbtxt | 2 +- .../v2}/tensorflow.keras.models.-model.pbtxt | 8 +- .../tensorflow.keras.models.-sequential.pbtxt | 12 +- ...mental.-sharpness-aware-minimization.pbtxt | 10 +- ...tensorflow.keras.models.experimental.pbtxt | 0 .../golden/v2/tensorflow.keras.models.pbtxt | 0 ...ensorflow.keras.optimizers.-adadelta.pbtxt | 6 +- ...nsorflow.keras.optimizers.-adafactor.pbtxt | 6 +- ...tensorflow.keras.optimizers.-adagrad.pbtxt | 6 +- .../tensorflow.keras.optimizers.-adam-w.pbtxt | 6 +- .../tensorflow.keras.optimizers.-adam.pbtxt | 6 +- .../tensorflow.keras.optimizers.-adamax.pbtxt | 6 +- .../tensorflow.keras.optimizers.-ftrl.pbtxt | 6 +- .../tensorflow.keras.optimizers.-lion.pbtxt | 6 +- .../tensorflow.keras.optimizers.-nadam.pbtxt | 6 +- ...nsorflow.keras.optimizers.-optimizer.pbtxt | 4 +- ...nsorflow.keras.optimizers.-r-m-sprop.pbtxt | 6 +- .../tensorflow.keras.optimizers.-s-g-d.pbtxt | 6 +- ...as.optimizers.experimental.-adadelta.pbtxt | 6 +- ...s.optimizers.experimental.-adafactor.pbtxt | 6 +- ...ras.optimizers.experimental.-adagrad.pbtxt | 6 +- ...eras.optimizers.experimental.-adam-w.pbtxt | 6 +- ....keras.optimizers.experimental.-adam.pbtxt | 6 +- ...eras.optimizers.experimental.-adamax.pbtxt | 6 +- ....keras.optimizers.experimental.-ftrl.pbtxt | 6 +- ...keras.optimizers.experimental.-nadam.pbtxt | 6 +- ...s.optimizers.experimental.-optimizer.pbtxt | 4 +- ...s.optimizers.experimental.-r-m-sprop.pbtxt | 6 +- ...keras.optimizers.experimental.-s-g-d.pbtxt | 6 +- ...orflow.keras.optimizers.experimental.pbtxt | 0 ...ow.keras.optimizers.legacy.-adadelta.pbtxt | 4 +- ...low.keras.optimizers.legacy.-adagrad.pbtxt | 4 +- ...orflow.keras.optimizers.legacy.-adam.pbtxt | 4 +- ...flow.keras.optimizers.legacy.-adamax.pbtxt | 4 +- ...orflow.keras.optimizers.legacy.-ftrl.pbtxt | 4 +- ...rflow.keras.optimizers.legacy.-nadam.pbtxt | 4 +- ...w.keras.optimizers.legacy.-optimizer.pbtxt | 2 +- ...w.keras.optimizers.legacy.-r-m-sprop.pbtxt | 4 +- ...rflow.keras.optimizers.legacy.-s-g-d.pbtxt | 4 +- .../tensorflow.keras.optimizers.legacy.pbtxt | 0 .../v2/tensorflow.keras.optimizers.pbtxt | 0 ...ers.schedules.-cosine-decay-restarts.pbtxt | 4 +- ...s.optimizers.schedules.-cosine-decay.pbtxt | 4 +- ...imizers.schedules.-exponential-decay.pbtxt | 4 +- ...mizers.schedules.-inverse-time-decay.pbtxt | 4 +- ...rs.schedules.-learning-rate-schedule.pbtxt | 2 +- ....schedules.-piecewise-constant-decay.pbtxt | 4 +- ...timizers.schedules.-polynomial-decay.pbtxt | 4 +- ...ensorflow.keras.optimizers.schedules.pbtxt | 0 .../api/golden/v2/tensorflow.keras.pbtxt | 0 ...processing.image.-directory-iterator.pbtxt | 8 +- ...ocessing.image.-image-data-generator.pbtxt | 2 +- ....keras.preprocessing.image.-iterator.pbtxt | 4 +- ...ocessing.image.-numpy-array-iterator.pbtxt | 6 +- ...tensorflow.keras.preprocessing.image.pbtxt | 0 .../v2/tensorflow.keras.preprocessing.pbtxt | 0 ...ssing.sequence.-timeseries-generator.pbtxt | 4 +- ...sorflow.keras.preprocessing.sequence.pbtxt | 0 ....keras.preprocessing.text.-tokenizer.pbtxt | 2 +- .../tensorflow.keras.preprocessing.text.pbtxt | 0 ...tensorflow.keras.regularizers.-l1-l2.pbtxt | 4 +- .../tensorflow.keras.regularizers.-l1.pbtxt | 4 +- .../tensorflow.keras.regularizers.-l2.pbtxt | 4 +- ...regularizers.-orthogonal-regularizer.pbtxt | 4 +- ...flow.keras.regularizers.-regularizer.pbtxt | 2 +- .../v2/tensorflow.keras.regularizers.l1.pbtxt | 4 +- .../tensorflow.keras.regularizers.l2.pbtxt | 4 +- ....regularizers.orthogonal_regularizer.pbtxt | 4 +- .../v2/tensorflow.keras.regularizers.pbtxt | 0 ...low.keras.saving.custom_object_scope.pbtxt | 2 +- .../golden/v2/tensorflow.keras.saving.pbtxt | 0 ...low.keras.utils.-custom-object-scope.pbtxt | 2 +- ...ensorflow.keras.utils.-feature-space.pbtxt | 6 +- ...flow.keras.utils.-generator-enqueuer.pbtxt | 4 +- ...orflow.keras.utils.-ordered-enqueuer.pbtxt | 4 +- .../v2/tensorflow.keras.utils.-progbar.pbtxt | 2 +- ...rflow.keras.utils.-sequence-enqueuer.pbtxt | 2 +- .../tensorflow.keras.utils.-sequence.pbtxt | 2 +- ...rflow.keras.utils.-sidecar-evaluator.pbtxt | 2 +- ...ras.utils.-steps-per-execution-tuner.pbtxt | 2 +- ...tensorflow.keras.utils.-timed-thread.pbtxt | 2 +- ...flow.keras.utils.custom_object_scope.pbtxt | 2 +- ....utils.experimental.-dataset-creator.pbtxt | 2 +- .../tensorflow.keras.utils.experimental.pbtxt | 0 .../v2/tensorflow.keras.utils.legacy.pbtxt | 0 .../golden/v2/tensorflow.keras.utils.pbtxt | 0 .../api/tests/API_UPDATE_WARNING.txt | 0 {keras => tf_keras}/api/tests/BUILD | 14 +- {keras => tf_keras}/api/tests/README.txt | 0 .../api/tests/api_compatibility_test.py | 4 +- {keras => tf_keras}/applications/BUILD | 104 +++--- tf_keras/applications/__init__.py | 64 ++++ .../applications_load_weight_test.py | 40 +-- .../applications/applications_test.py | 42 +-- {keras => tf_keras}/applications/convnext.py | 24 +- {keras => tf_keras}/applications/densenet.py | 28 +- .../applications/efficientnet.py | 22 +- .../applications/efficientnet_v2.py | 22 +- .../applications/imagenet_utils.py | 6 +- .../applications/imagenet_utils_test.py | 8 +- .../applications/inception_resnet_v2.py | 24 +- .../applications/inception_v3.py | 20 +- {keras => tf_keras}/applications/mobilenet.py | 20 +- .../applications/mobilenet_v2.py | 26 +- .../applications/mobilenet_v3.py | 20 +- {keras => tf_keras}/applications/nasnet.py | 44 +-- {keras => tf_keras}/applications/regnet.py | 20 +- {keras => tf_keras}/applications/resnet.py | 22 +- {keras => tf_keras}/applications/resnet_rs.py | 20 +- {keras => tf_keras}/applications/resnet_v2.py | 10 +- {keras => tf_keras}/applications/vgg16.py | 18 +- {keras => tf_keras}/applications/vgg19.py | 18 +- {keras => tf_keras}/applications/xception.py | 18 +- {keras => tf_keras}/backend.py | 166 ++++----- {keras => tf_keras}/backend_config.py | 2 +- {keras => tf_keras}/backend_config_test.py | 6 +- {keras => tf_keras}/backend_test.py | 24 +- {keras => tf_keras}/benchmarks/BUILD | 30 +- tf_keras/benchmarks/README.md | 3 + {keras => tf_keras}/benchmarks/__init__.py | 0 .../benchmarks/benchmark_util.py | 4 +- .../benchmarks/benchmark_util_test.py | 2 +- .../benchmarks/distribution_util.py | 0 .../benchmarks/eager_microbenchmarks_test.py | 4 +- .../benchmarks/keras_cpu_benchmark_test.py | 4 +- .../keras_examples_benchmarks/BUILD | 62 ++-- .../keras_examples_benchmarks/README.md | 28 +- .../antirectifier_benchmark_test.py | 2 +- .../bidirectional_lstm_benchmark_test.py | 2 +- .../cifar10_cnn_benchmark_test.py | 4 +- .../mnist_conv_benchmark_test.py | 2 +- ...ist_conv_custom_training_benchmark_test.py | 4 +- .../mnist_hierarchical_rnn_benchmark_test.py | 4 +- .../mnist_irnn_benchmark_test.py | 4 +- .../reuters_mlp_benchmark_test.py | 4 +- ...assification_transformer_benchmark_test.py | 4 +- .../benchmarks/layer_benchmarks/BUILD | 12 +- .../layer_benchmarks/layer_benchmarks_test.py | 6 +- .../layer_benchmarks_test_base.py | 4 +- .../benchmarks/layer_benchmarks/run_xprof.py | 0 .../metrics_memory_benchmark_test.py | 2 +- .../model_components_benchmarks_test.py | 2 +- .../benchmarks/model_memory_profile.py | 4 +- .../benchmarks/optimizer_benchmarks_test.py | 6 +- .../benchmarks/saved_model_benchmarks/BUILD | 40 +-- .../densenet_benchmark_test.py | 2 +- .../efficientnet_benchmark_test.py | 2 +- .../inception_resnet_v2_benchmark_test.py | 2 +- .../mobilenet_benchmark_test.py | 2 +- .../nasnet_large_benchmark_test.py | 2 +- .../resnet152_v2_benchmark_test.py | 2 +- .../saved_model_benchmark_util.py | 2 +- .../vgg_benchmark_test.py | 2 +- .../xception_benchmark_test.py | 2 +- {keras => tf_keras}/callbacks.py | 58 +-- {keras => tf_keras}/callbacks_test.py | 40 +-- {keras => tf_keras}/callbacks_v1.py | 8 +- {keras => tf_keras}/callbacks_v1_test.py | 20 +- {keras => tf_keras}/constraints.py | 10 +- {keras => tf_keras}/constraints_test.py | 8 +- {keras => tf_keras}/datasets/BUILD | 10 +- {keras => tf_keras}/datasets/__init__.py | 0 .../datasets/boston_housing.py | 2 +- {keras => tf_keras}/datasets/cifar.py | 0 {keras => tf_keras}/datasets/cifar10.py | 6 +- {keras => tf_keras}/datasets/cifar100.py | 6 +- {keras => tf_keras}/datasets/fashion_mnist.py | 2 +- {keras => tf_keras}/datasets/imdb.py | 4 +- {keras => tf_keras}/datasets/mnist.py | 2 +- {keras => tf_keras}/datasets/reuters.py | 8 +- {keras => tf_keras}/distribute/BUILD | 188 +++++----- tf_keras/distribute/README.md | 6 + {keras => tf_keras}/distribute/__init__.py | 0 .../distribute/checkpointing_test.py | 2 +- .../collective_all_reduce_strategy_test.py | 8 +- .../distribute/ctl_correctness_test.py | 14 +- .../custom_training_loop_metrics_test.py | 4 +- .../custom_training_loop_models_test.py | 8 +- .../custom_training_loop_optimizer_test.py | 4 +- .../dataset_creator_model_fit_ps_only_test.py | 8 +- .../dataset_creator_model_fit_test.py | 8 +- .../dataset_creator_model_fit_test_base.py | 14 +- .../distribute_coordinator_utils.py | 0 .../distribute/distribute_strategy_test.py | 36 +- .../distribute/distributed_file_utils.py | 0 .../distribute/distributed_file_utils_test.py | 2 +- .../distribute/distributed_training_utils.py | 2 +- .../distributed_training_utils_test.py | 8 +- .../distributed_training_utils_v1.py | 38 +- .../distribute/keras_correctness_test_base.py | 24 +- .../distribute/keras_dnn_correctness_test.py | 12 +- .../keras_embedding_model_correctness_test.py | 6 +- .../keras_image_model_correctness_test.py | 8 +- .../distribute/keras_metrics_test.py | 6 +- .../distribute/keras_models_test.py | 6 +- .../distribute/keras_optimizer_v2_test.py | 6 +- .../distribute/keras_premade_models_test.py | 14 +- .../keras_rnn_model_correctness_test.py | 18 +- .../distribute/keras_save_load_test.py | 6 +- ...as_stateful_lstm_model_correctness_test.py | 6 +- .../distribute/keras_utils_test.py | 10 +- .../distribute/minimize_loss_test.py | 10 +- .../distribute/mirrored_strategy_test.py | 10 +- .../distribute/mirrored_variable_test.py | 4 +- .../distribute/model_checkpoint_test.py | 4 +- .../distribute/model_collection_base.py | 0 .../distribute/model_combinations.py | 2 +- .../multi_worker_callback_tf2_test.py | 12 +- .../distribute/multi_worker_test.py | 20 +- .../distribute/multi_worker_testing_utils.py | 6 +- .../distribute/optimizer_combinations.py | 18 +- .../parameter_server_evaluation_test.py | 8 +- .../parameter_server_exact_evaluation_test.py | 12 +- .../distribute/saved_model_mixed_api_test.py | 6 +- .../distribute/saved_model_save_load_test.py | 6 +- .../distribute/saved_model_test_base.py | 2 +- .../distribute/sharded_variable_test.py | 10 +- .../distribute/simple_models.py | 6 +- .../distribute/strategy_combinations.py | 0 .../distribute/test_example.py | 6 +- .../distribute/tpu_strategy_test_utils.py | 0 .../distribute/worker_training_state.py | 8 +- .../distribute/worker_training_state_test.py | 4 +- {keras => tf_keras}/dtensor/BUILD | 84 ++--- {keras => tf_keras}/dtensor/__init__.py | 0 .../dtensor/initializers_test.py | 10 +- .../dtensor/integration_test_utils.py | 16 +- {keras => tf_keras}/dtensor/layers_test.py | 10 +- {keras => tf_keras}/dtensor/layout_map.py | 18 +- .../dtensor/layout_map_test.py | 14 +- {keras => tf_keras}/dtensor/lazy_variable.py | 2 +- {keras => tf_keras}/dtensor/metrics_test.py | 8 +- .../dtensor/mnist_model_test.py | 12 +- .../dtensor/optimizers_test.py | 26 +- {keras => tf_keras}/dtensor/save_load_test.py | 14 +- .../dtensor/strategy_integration_test.py | 10 +- {keras => tf_keras}/dtensor/test_util.py | 0 {keras => tf_keras}/dtensor/utils.py | 8 +- {keras => tf_keras}/dtensor/utils_test.py | 8 +- {keras => tf_keras}/engine/BUILD | 339 +++++++++--------- {keras => tf_keras}/engine/__init__.py | 0 {keras => tf_keras}/engine/base_layer.py | 84 ++--- {keras => tf_keras}/engine/base_layer_test.py | 28 +- .../engine/base_layer_utils.py | 52 +-- .../engine/base_layer_utils_test.py | 8 +- {keras => tf_keras}/engine/base_layer_v1.py | 52 +-- .../engine/base_preprocessing_layer.py | 8 +- .../engine/base_preprocessing_layer_test.py | 8 +- {keras => tf_keras}/engine/compile_utils.py | 12 +- .../engine/compile_utils_test.py | 10 +- .../engine/control_flow_test.py | 12 +- .../engine/correctness_test.py | 6 +- {keras => tf_keras}/engine/data_adapter.py | 18 +- .../engine/data_adapter_test.py | 10 +- .../engine/deferred_sequential_test.py | 6 +- .../feature_columns_integration_test.py | 12 +- {keras => tf_keras}/engine/functional.py | 54 +-- {keras => tf_keras}/engine/functional_test.py | 36 +- .../engine/functional_utils.py | 8 +- .../engine/functional_utils_test.py | 10 +- {keras => tf_keras}/engine/input_layer.py | 40 +-- .../engine/input_layer_test.py | 46 +-- {keras => tf_keras}/engine/input_spec.py | 4 +- {keras => tf_keras}/engine/input_spec_test.py | 2 +- {keras => tf_keras}/engine/keras_tensor.py | 36 +- .../engine/keras_tensor_test.py | 10 +- {keras => tf_keras}/engine/node.py | 18 +- {keras => tf_keras}/engine/node_test.py | 6 +- .../engine/partial_batch_padding_handler.py | 2 +- .../engine/ragged_keras_tensor_test.py | 8 +- {keras => tf_keras}/engine/saving.py | 2 +- {keras => tf_keras}/engine/sequential.py | 32 +- {keras => tf_keras}/engine/sequential_test.py | 6 +- {keras => tf_keras}/engine/training.py | 104 +++--- .../engine/training_arrays_test.py | 12 +- .../engine/training_arrays_v1.py | 20 +- .../engine/training_dataset_test.py | 12 +- .../engine/training_distributed_v1.py | 28 +- .../engine/training_eager_test.py | 10 +- .../engine/training_eager_v1.py | 10 +- .../engine/training_generator_test.py | 20 +- .../engine/training_generator_v1.py | 18 +- .../engine/training_gpu_test.py | 12 +- .../engine/training_integration_test.py | 6 +- {keras => tf_keras}/engine/training_test.py | 40 +-- {keras => tf_keras}/engine/training_utils.py | 2 +- .../engine/training_utils_v1.py | 22 +- .../engine/training_utils_v1_test.py | 10 +- {keras => tf_keras}/engine/training_v1.py | 68 ++-- {keras => tf_keras}/estimator/BUILD | 6 +- {keras => tf_keras}/estimator/__init__.py | 46 +-- {keras => tf_keras}/export/BUILD | 14 +- {keras => tf_keras}/export/__init__.py | 2 +- {keras => tf_keras}/export/export_lib.py | 29 +- {keras => tf_keras}/export/export_lib_test.py | 51 ++- {keras => tf_keras}/feature_column/BUILD | 38 +- .../feature_column/__init__.py | 0 .../feature_column/base_feature_layer.py | 6 +- .../feature_column/dense_features.py | 8 +- .../feature_column/dense_features_test.py | 4 +- .../feature_column/dense_features_v2.py | 6 +- .../feature_column/dense_features_v2_test.py | 4 +- .../feature_column/sequence_feature_column.py | 4 +- ...equence_feature_column_integration_test.py | 12 +- .../sequence_feature_column_test.py | 8 +- {keras => tf_keras}/initializers/BUILD | 26 +- {keras => tf_keras}/initializers/__init__.py | 14 +- .../initializers/initializers.py | 42 +-- .../initializers/initializers_test.py | 16 +- .../initializers/initializers_v1.py | 0 {keras => tf_keras}/integration_test/BUILD | 108 +++--- .../integration_test/README.md | 6 +- .../central_storage_strategy_test.py | 2 +- .../integration_test/ctl_tutorial_test.py | 4 +- .../custom_object_saving_test.py | 8 +- .../integration_test/data/sentencepiece.pb | Bin .../distributed_training_test.py | 4 +- .../integration_test/extension_type_test.py | 14 +- .../integration_test/fit_test.py | 34 +- .../integration_test/forwardprop_test.py | 0 .../integration_test/function_test.py | 0 .../gradient_checkpoint_test.py | 0 .../integration_test/gradients_test.py | 2 +- .../integration_test/legacy_rnn_test.py | 2 +- .../integration_test/models/BUILD | 6 +- .../integration_test/models/__init__.py | 0 .../integration_test/models/bert.py | 4 +- .../integration_test/models/ctc_speech_rnn.py | 4 +- .../integration_test/models/dcgan.py | 6 +- .../models/edge_case_model.py | 4 +- .../models/efficientnet_v2.py | 6 +- .../integration_test/models/input_spec.py | 0 .../models/low_level_model.py | 4 +- .../integration_test/models/mini_unet.py | 4 +- .../integration_test/models/mini_xception.py | 4 +- .../integration_test/models/retinanet.py | 6 +- .../models/structured_data_classification.py | 4 +- .../models/text_classification.py | 4 +- .../models/timeseries_forecasting.py | 4 +- .../integration_test/models/translation.py | 4 +- .../integration_test/models/vae.py | 6 +- .../integration_test/module_test.py | 0 .../multi_worker_tutorial_test.py | 0 .../mwms_multi_process_runner_test.py | 4 +- ...ameter_server_custom_training_loop_test.py | 0 ...rameter_server_keras_preprocessing_test.py | 4 +- .../parameter_server_training_metric_test.py | 10 +- ...cessing_applied_in_dataset_creator_test.py | 6 +- .../preprocessing_applied_in_dataset_test.py | 6 +- .../preprocessing_applied_in_model_test.py | 6 +- .../preprocessing_test_utils.py | 2 +- .../integration_test/py_metric_test.py | 10 +- .../integration_test/saved_model_test.py | 0 .../integration_test/saving_v3_test.py | 28 +- .../integration_test/tf_trt_test.py | 4 +- .../integration_test/tpu_strategy_test.py | 0 .../integration_test/vectorized_map_test.py | 0 .../kokoro/github/ubuntu/cpu/build.sh | 0 .../kokoro/github/ubuntu/cpu/continuous.cfg | 0 .../kokoro/github/ubuntu/cpu/presubmit.cfg | 0 .../kokoro/github/ubuntu/gpu/build.sh | 0 .../kokoro/github/ubuntu/gpu/continuous.cfg | 0 .../kokoro/github/ubuntu/gpu/presubmit.cfg | 0 {keras => tf_keras}/layers/BUILD | 80 ++--- tf_keras/layers/__init__.py | 292 +++++++++++++++ {keras => tf_keras}/layers/activation/BUILD | 88 ++--- .../layers/activation/__init__.py | 12 +- {keras => tf_keras}/layers/activation/elu.py | 6 +- .../layers/activation/elu_test.py | 6 +- .../layers/activation/leaky_relu.py | 6 +- .../layers/activation/leaky_relu_test.py | 6 +- .../layers/activation/prelu.py | 14 +- .../layers/activation/prelu_test.py | 6 +- {keras => tf_keras}/layers/activation/relu.py | 6 +- .../layers/activation/relu_test.py | 6 +- .../layers/activation/softmax.py | 6 +- .../layers/activation/softmax_test.py | 6 +- .../layers/activation/thresholded_relu.py | 6 +- .../activation/thresholded_relu_test.py | 6 +- {keras => tf_keras}/layers/attention/BUILD | 60 ++-- .../layers/attention/__init__.py | 6 +- .../layers/attention/additive_attention.py | 2 +- .../attention/additive_attention_test.py | 8 +- .../layers/attention/attention.py | 2 +- .../layers/attention/attention_test.py | 6 +- .../layers/attention/base_dense_attention.py | 6 +- .../attention/base_dense_attention_test.py | 6 +- .../layers/attention/multi_head_attention.py | 22 +- .../attention/multi_head_attention_test.py | 8 +- tf_keras/layers/convolutional/BUILD | 307 ++++++++++++++++ tf_keras/layers/convolutional/__init__.py | 56 +++ .../layers/convolutional/base_conv.py | 18 +- .../convolutional/base_depthwise_conv.py | 12 +- .../convolutional/base_separable_conv.py | 12 +- .../layers/convolutional/conv1d.py | 12 +- .../layers/convolutional/conv1d_transpose.py | 16 +- .../layers/convolutional/conv2d.py | 14 +- .../layers/convolutional/conv2d_transpose.py | 18 +- .../layers/convolutional/conv3d.py | 14 +- .../layers/convolutional/conv3d_transpose.py | 16 +- .../layers/convolutional/conv_test.py | 6 +- .../convolutional/conv_transpose_test.py | 6 +- .../layers/convolutional/depthwise_conv1d.py | 8 +- .../layers/convolutional/depthwise_conv2d.py | 10 +- .../convolutional/depthwise_conv_test.py | 6 +- .../layers/convolutional/separable_conv1d.py | 12 +- .../layers/convolutional/separable_conv2d.py | 12 +- .../convolutional/separable_conv_test.py | 6 +- {keras => tf_keras}/layers/core/BUILD | 101 +++--- tf_keras/layers/core/__init__.py | 47 +++ {keras => tf_keras}/layers/core/activation.py | 4 +- {keras => tf_keras}/layers/core/core_test.py | 18 +- {keras => tf_keras}/layers/core/dense.py | 16 +- .../layers/core/einsum_dense.py | 12 +- .../layers/core/einsum_dense_test.py | 10 +- {keras => tf_keras}/layers/core/embedding.py | 28 +- .../layers/core/embedding_test.py | 21 +- {keras => tf_keras}/layers/core/identity.py | 2 +- .../layers/core/lambda_layer.py | 12 +- {keras => tf_keras}/layers/core/masking.py | 4 +- .../layers/core/tf_op_layer.py | 20 +- {keras => tf_keras}/layers/kernelized.py | 8 +- {keras => tf_keras}/layers/kernelized_test.py | 20 +- {keras => tf_keras}/layers/layers_test.py | 2 +- .../layers/locally_connected/BUILD | 58 +-- .../layers/locally_connected/__init__.py | 4 +- .../locally_connected/locally_connected1d.py | 22 +- .../locally_connected/locally_connected2d.py | 22 +- .../locally_connected_test.py | 10 +- .../locally_connected_utils.py | 4 +- {keras => tf_keras}/layers/merging/BUILD | 32 +- tf_keras/layers/merging/__init__.py | 35 ++ {keras => tf_keras}/layers/merging/add.py | 2 +- {keras => tf_keras}/layers/merging/average.py | 2 +- .../layers/merging/base_merge.py | 6 +- .../layers/merging/concatenate.py | 6 +- {keras => tf_keras}/layers/merging/dot.py | 8 +- {keras => tf_keras}/layers/merging/maximum.py | 2 +- .../layers/merging/merging_test.py | 10 +- {keras => tf_keras}/layers/merging/minimum.py | 2 +- .../layers/merging/multiply.py | 2 +- .../layers/merging/subtract.py | 8 +- {keras => tf_keras}/layers/noise.py | 6 +- .../layers/normalization/BUILD | 94 ++--- .../layers/normalization/__init__.py | 0 .../normalization/batch_normalization.py | 24 +- .../batch_normalization_dtensor_test.py | 8 +- .../normalization/batch_normalization_test.py | 12 +- .../normalization/batch_normalization_v1.py | 2 +- .../normalization/group_normalization.py | 16 +- .../normalization/group_normalization_test.py | 12 +- .../normalization/layer_normalization.py | 12 +- .../normalization/layer_normalization_test.py | 8 +- .../normalization/spectral_normalization.py | 6 +- .../spectral_normalization_test.py | 8 +- .../normalization/unit_normalization.py | 4 +- .../normalization/unit_normalization_test.py | 6 +- {keras => tf_keras}/layers/pooling/BUILD | 98 ++--- tf_keras/layers/pooling/__init__.py | 43 +++ .../layers/pooling/average_pooling1d.py | 4 +- .../layers/pooling/average_pooling2d.py | 4 +- .../layers/pooling/average_pooling3d.py | 4 +- .../layers/pooling/average_pooling_test.py | 6 +- .../layers/pooling/base_global_pooling1d.py | 6 +- .../layers/pooling/base_global_pooling2d.py | 6 +- .../layers/pooling/base_global_pooling3d.py | 6 +- .../layers/pooling/base_pooling1d.py | 8 +- .../layers/pooling/base_pooling2d.py | 8 +- .../layers/pooling/base_pooling3d.py | 8 +- .../pooling/global_average_pooling1d.py | 4 +- .../pooling/global_average_pooling2d.py | 6 +- .../pooling/global_average_pooling3d.py | 6 +- .../pooling/global_average_pooling_test.py | 8 +- .../layers/pooling/global_max_pooling1d.py | 4 +- .../layers/pooling/global_max_pooling2d.py | 6 +- .../layers/pooling/global_max_pooling3d.py | 6 +- .../layers/pooling/global_max_pooling_test.py | 6 +- .../layers/pooling/max_pooling1d.py | 4 +- .../layers/pooling/max_pooling2d.py | 4 +- .../layers/pooling/max_pooling3d.py | 4 +- .../layers/pooling/max_pooling_test.py | 6 +- .../layers/preprocessing/BUILD | 208 +++++------ .../layers/preprocessing/__init__.py | 0 .../layers/preprocessing/benchmarks/BUILD | 64 ++-- .../preprocessing/benchmarks/__init__.py | 0 .../bucketized_column_dense_benchmark.py | 8 +- .../benchmarks/category_encoding_benchmark.py | 6 +- .../category_hash_dense_benchmark.py | 8 +- .../category_hash_varlen_benchmark.py | 8 +- .../category_vocab_file_dense_benchmark.py | 8 +- .../category_vocab_file_varlen_benchmark.py | 8 +- .../category_vocab_list_dense_benchmark.py | 8 +- ...ry_vocab_list_indicator_dense_benchmark.py | 10 +- ...y_vocab_list_indicator_varlen_benchmark.py | 10 +- .../category_vocab_list_varlen_benchmark.py | 8 +- .../discretization_adapt_benchmark.py | 6 +- .../benchmarks/embedding_dense_benchmark.py | 6 +- .../benchmarks/embedding_varlen_benchmark.py | 6 +- .../benchmarks/feature_column_benchmark.py | 6 +- .../benchmarks/hashed_crossing_benchmark.py | 8 +- .../benchmarks/hashing_benchmark.py | 6 +- .../benchmarks/image_preproc_benchmark.py | 6 +- .../index_lookup_adapt_benchmark.py | 6 +- .../index_lookup_forward_benchmark.py | 6 +- .../normalization_adapt_benchmark.py | 6 +- .../weighted_embedding_varlen_benchmark.py | 6 +- .../layers/preprocessing/category_encoding.py | 12 +- .../category_encoding_distribution_test.py | 14 +- .../preprocessing/category_encoding_test.py | 14 +- .../layers/preprocessing/discretization.py | 12 +- .../discretization_distribution_test.py | 12 +- .../preprocessing/discretization_test.py | 14 +- .../layers/preprocessing/hashed_crossing.py | 12 +- .../preprocessing/hashed_crossing_test.py | 8 +- .../layers/preprocessing/hashing.py | 12 +- .../hashing_distribution_test.py | 14 +- .../layers/preprocessing/hashing_test.py | 14 +- .../preprocessing/image_preprocessing.py | 36 +- .../image_preprocessing_distribution_test.py | 12 +- .../preprocessing/image_preprocessing_test.py | 10 +- .../layers/preprocessing/index_lookup.py | 16 +- .../index_lookup_distribution_test.py | 14 +- .../layers/preprocessing/index_lookup_test.py | 16 +- .../layers/preprocessing/integer_lookup.py | 6 +- .../preprocessing/integer_lookup_test.py | 14 +- .../layers/preprocessing/normalization.py | 8 +- .../normalization_distribution_test.py | 14 +- .../preprocessing/normalization_test.py | 14 +- .../preprocessing/preprocessing_stage.py | 8 +- .../preprocessing_stage_functional_test.py | 20 +- .../preprocessing/preprocessing_stage_test.py | 8 +- .../preprocessing/preprocessing_test_utils.py | 0 .../preprocessing/preprocessing_utils.py | 2 +- .../preprocessing/preprocessing_utils_test.py | 4 +- .../layers/preprocessing/string_lookup.py | 6 +- .../preprocessing/string_lookup_test.py | 14 +- .../preprocessing/text_vectorization.py | 20 +- .../text_vectorization_distribution_test.py | 14 +- .../preprocessing/text_vectorization_test.py | 22 +- .../layers/regularization/BUILD | 80 ++--- .../layers/regularization/__init__.py | 16 +- .../regularization/activity_regularization.py | 4 +- .../activity_regularization_test.py | 4 +- .../layers/regularization/alpha_dropout.py | 6 +- .../regularization/alpha_dropout_test.py | 6 +- .../layers/regularization/dropout.py | 6 +- .../layers/regularization/dropout_test.py | 6 +- .../layers/regularization/gaussian_dropout.py | 6 +- .../regularization/gaussian_dropout_test.py | 6 +- .../layers/regularization/gaussian_noise.py | 6 +- .../regularization/gaussian_noise_test.py | 6 +- .../regularization/spatial_dropout1d.py | 4 +- .../regularization/spatial_dropout2d.py | 8 +- .../regularization/spatial_dropout3d.py | 8 +- .../regularization/spatial_dropout_test.py | 6 +- {keras => tf_keras}/layers/reshaping/BUILD | 137 ++++--- tf_keras/layers/reshaping/__init__.py | 29 ++ .../layers/reshaping/cropping1d.py | 6 +- .../layers/reshaping/cropping2d.py | 8 +- .../layers/reshaping/cropping3d.py | 8 +- .../layers/reshaping/cropping_test.py | 6 +- .../layers/reshaping/flatten.py | 8 +- .../layers/reshaping/flatten_test.py | 6 +- .../layers/reshaping/permute.py | 4 +- .../layers/reshaping/permute_test.py | 8 +- .../layers/reshaping/repeat_vector.py | 6 +- .../layers/reshaping/repeat_vector_test.py | 6 +- .../layers/reshaping/reshape.py | 2 +- .../layers/reshaping/reshape_test.py | 6 +- .../layers/reshaping/up_sampling1d.py | 6 +- .../layers/reshaping/up_sampling2d.py | 12 +- .../layers/reshaping/up_sampling3d.py | 10 +- .../layers/reshaping/up_sampling_test.py | 6 +- .../layers/reshaping/zero_padding1d.py | 8 +- .../layers/reshaping/zero_padding2d.py | 10 +- .../layers/reshaping/zero_padding3d.py | 10 +- .../layers/reshaping/zero_padding_test.py | 6 +- {keras => tf_keras}/layers/rnn/BUILD | 316 ++++++++-------- tf_keras/layers/rnn/__init__.py | 73 ++++ .../layers/rnn/abstract_rnn_cell.py | 6 +- .../layers/rnn/base_conv_lstm.py | 22 +- .../layers/rnn/base_conv_rnn.py | 14 +- .../layers/rnn/base_cudnn_rnn.py | 6 +- {keras => tf_keras}/layers/rnn/base_rnn.py | 32 +- .../layers/rnn/base_rnn_test.py | 16 +- .../layers/rnn/base_wrapper.py | 10 +- .../layers/rnn/base_wrapper_test.py | 2 +- .../layers/rnn/bidirectional.py | 24 +- .../layers/rnn/bidirectional_test.py | 12 +- .../layers/rnn/cell_wrappers.py | 14 +- .../layers/rnn/cell_wrappers_test.py | 12 +- {keras => tf_keras}/layers/rnn/conv_lstm1d.py | 4 +- {keras => tf_keras}/layers/rnn/conv_lstm2d.py | 4 +- {keras => tf_keras}/layers/rnn/conv_lstm3d.py | 4 +- .../layers/rnn/conv_lstm_test.py | 6 +- {keras => tf_keras}/layers/rnn/cudnn_gru.py | 10 +- {keras => tf_keras}/layers/rnn/cudnn_lstm.py | 10 +- {keras => tf_keras}/layers/rnn/cudnn_test.py | 8 +- .../layers/rnn/dropout_rnn_cell_mixin.py | 2 +- {keras => tf_keras}/layers/rnn/gru.py | 30 +- .../layers/rnn/gru_lstm_test.py | 10 +- .../layers/rnn/gru_lstm_utils.py | 8 +- {keras => tf_keras}/layers/rnn/gru_test.py | 10 +- {keras => tf_keras}/layers/rnn/gru_v1.py | 16 +- {keras => tf_keras}/layers/rnn/gru_v1_test.py | 12 +- .../layers/rnn/legacy_cell_wrappers.py | 10 +- .../layers/rnn/legacy_cell_wrappers_test.py | 6 +- .../layers/rnn/legacy_cells.py | 22 +- {keras => tf_keras}/layers/rnn/lstm.py | 30 +- {keras => tf_keras}/layers/rnn/lstm_test.py | 18 +- {keras => tf_keras}/layers/rnn/lstm_v1.py | 16 +- .../layers/rnn/lstm_v1_test.py | 12 +- {keras => tf_keras}/layers/rnn/rnn_utils.py | 2 +- {keras => tf_keras}/layers/rnn/simple_rnn.py | 26 +- .../layers/rnn/simple_rnn_test.py | 6 +- .../layers/rnn/stacked_rnn_cells.py | 14 +- .../layers/rnn/time_distributed.py | 14 +- .../layers/rnn/time_distributed_test.py | 6 +- {keras => tf_keras}/layers/serialization.py | 84 ++--- .../layers/serialization_test.py | 18 +- .../layers/subclassed_layers_test.py | 10 +- .../layers/tensorflow_op_layer_test.py | 24 +- {keras => tf_keras}/legacy_tf_layers/BUILD | 41 ++- tf_keras/legacy_tf_layers/__init__.py | 3 + {keras => tf_keras}/legacy_tf_layers/base.py | 24 +- .../legacy_tf_layers/base_test.py | 16 +- .../legacy_tf_layers/convolutional.py | 46 +-- .../legacy_tf_layers/convolutional_test.py | 2 +- {keras => tf_keras}/legacy_tf_layers/core.py | 22 +- .../legacy_tf_layers/core_test.py | 4 +- .../legacy_tf_layers/migration_utils.py | 0 .../legacy_tf_layers/migration_utils_test.py | 2 +- .../legacy_tf_layers/normalization.py | 12 +- .../legacy_tf_layers/normalization_test.py | 4 +- .../legacy_tf_layers/pooling.py | 40 +-- .../legacy_tf_layers/pooling_test.py | 2 +- .../legacy_tf_layers/variable_scope_shim.py | 50 +-- .../variable_scope_shim_test.py | 24 +- {keras => tf_keras}/losses.py | 24 +- {keras => tf_keras}/losses_test.py | 16 +- {keras => tf_keras}/metrics/BUILD | 114 +++--- tf_keras/metrics/__init__.py | 224 ++++++++++++ .../metrics/accuracy_metrics.py | 8 +- .../metrics/accuracy_metrics_test.py | 8 +- {keras => tf_keras}/metrics/base_metric.py | 30 +- .../metrics/base_metric_test.py | 16 +- .../metrics/confusion_metrics.py | 14 +- .../metrics/confusion_metrics_test.py | 14 +- .../metrics/f_score_metrics.py | 4 +- .../metrics/f_score_metrics_test.py | 4 +- {keras => tf_keras}/metrics/hinge_metrics.py | 10 +- .../metrics/hinge_metrics_test.py | 6 +- {keras => tf_keras}/metrics/iou_metrics.py | 6 +- .../metrics/iou_metrics_test.py | 6 +- .../metrics/metrics_correctness_test.py | 14 +- .../metrics/metrics_functional_test.py | 8 +- .../metrics/probabilistic_metrics.py | 14 +- .../metrics/probabilistic_metrics_test.py | 6 +- {keras => tf_keras}/metrics/py_metric.py | 4 +- {keras => tf_keras}/metrics/py_metric_test.py | 8 +- .../metrics/regression_metrics.py | 22 +- .../metrics/regression_metrics_test.py | 10 +- {keras => tf_keras}/mixed_precision/BUILD | 70 ++-- .../mixed_precision/__init__.py | 10 +- .../mixed_precision/autocast_variable.py | 21 +- .../mixed_precision/autocast_variable_test.py | 70 ++-- .../device_compatibility_check.py | 0 .../device_compatibility_check_test.py | 4 +- .../mixed_precision/layer_correctness_test.py | 52 +-- .../mixed_precision/layer_test.py | 22 +- .../mixed_precision/loss_scale_optimizer.py | 26 +- .../loss_scale_optimizer_test.py | 24 +- .../mixed_precision_graph_rewrite_test.py | 14 +- .../mixed_precision/model_test.py | 65 ++-- {keras => tf_keras}/mixed_precision/policy.py | 16 +- .../mixed_precision/policy_test.py | 12 +- .../mixed_precision/test_util.py | 8 +- .../mixed_precision/testdata/BUILD | 4 +- .../testdata/lso_ckpt_tf2.2/checkpoint | 0 .../lso_ckpt_tf2.2/ckpt.data-00000-of-00002 | 0 .../lso_ckpt_tf2.2/ckpt.data-00001-of-00002 | Bin .../testdata/lso_ckpt_tf2.2/ckpt.index | Bin .../lso_savedmodel_tf2.2/saved_model.pb | Bin .../variables/variables.data-00000-of-00002 | Bin .../variables/variables.data-00001-of-00002 | Bin .../variables/variables.index | Bin {keras => tf_keras}/models/BUILD | 42 +-- tf_keras/models/__init__.py | 36 ++ {keras => tf_keras}/models/cloning.py | 46 +-- {keras => tf_keras}/models/cloning_test.py | 14 +- .../models/sharpness_aware_minimization.py | 10 +- .../sharpness_aware_minimization_test.py | 8 +- tf_keras/opensource_only.files | 3 + {keras => tf_keras}/optimizers/BUILD | 48 +-- {keras => tf_keras}/optimizers/__init__.py | 86 ++--- {keras => tf_keras}/optimizers/adadelta.py | 6 +- {keras => tf_keras}/optimizers/adafactor.py | 6 +- {keras => tf_keras}/optimizers/adagrad.py | 6 +- {keras => tf_keras}/optimizers/adam.py | 4 +- {keras => tf_keras}/optimizers/adamax.py | 4 +- {keras => tf_keras}/optimizers/adamw.py | 4 +- {keras => tf_keras}/optimizers/ftrl.py | 6 +- {keras => tf_keras}/optimizers/legacy/BUILD | 44 +-- .../optimizers/legacy/__init__.py | 0 .../optimizers/legacy/adadelta.py | 8 +- .../optimizers/legacy/adadelta_test.py | 4 +- .../optimizers/legacy/adagrad.py | 6 +- .../optimizers/legacy/adagrad_test.py | 6 +- {keras => tf_keras}/optimizers/legacy/adam.py | 8 +- .../optimizers/legacy/adam_test.py | 8 +- .../optimizers/legacy/adamax.py | 4 +- .../optimizers/legacy/adamax_test.py | 4 +- {keras => tf_keras}/optimizers/legacy/ftrl.py | 4 +- .../optimizers/legacy/ftrl_test.py | 2 +- .../optimizers/legacy/gradient_descent.py | 2 +- .../legacy/gradient_descent_test.py | 6 +- .../optimizers/legacy/nadam.py | 6 +- .../optimizers/legacy/nadam_test.py | 2 +- .../optimizers/legacy/optimizer_v2.py | 36 +- .../optimizers/legacy/optimizer_v2_test.py | 46 +-- .../optimizers/legacy/rmsprop.py | 6 +- .../optimizers/legacy/rmsprop_test.py | 8 +- .../optimizers/legacy_learning_rate_decay.py | 2 +- .../legacy_learning_rate_decay_test.py | 2 +- {keras => tf_keras}/optimizers/lion.py | 4 +- {keras => tf_keras}/optimizers/lion_test.py | 2 +- {keras => tf_keras}/optimizers/nadam.py | 4 +- {keras => tf_keras}/optimizers/optimizer.py | 22 +- .../optimizers/optimizer_pss_test.py | 26 +- .../optimizers/optimizer_test.py | 44 +-- .../optimizers/optimizer_v1.py | 6 +- .../optimizers/optimizer_v1_test.py | 12 +- {keras => tf_keras}/optimizers/rmsprop.py | 4 +- tf_keras/optimizers/schedules/BUILD | 43 +++ .../optimizers/schedules/__init__.py | 8 +- .../schedules/learning_rate_schedule.py | 12 +- .../schedules/learning_rate_schedule_test.py | 6 +- {keras => tf_keras}/optimizers/sgd.py | 4 +- {keras => tf_keras}/optimizers/utils.py | 0 {keras => tf_keras}/premade_models/BUILD | 20 +- .../premade_models/__init__.py | 4 +- {keras => tf_keras}/premade_models/linear.py | 14 +- .../premade_models/linear_test.py | 22 +- .../premade_models/wide_deep.py | 14 +- .../premade_models/wide_deep_test.py | 22 +- {keras => tf_keras}/preprocessing/BUILD | 26 +- {keras => tf_keras}/preprocessing/__init__.py | 10 +- {keras => tf_keras}/preprocessing/image.py | 28 +- .../preprocessing/image_test.py | 12 +- {keras => tf_keras}/preprocessing/sequence.py | 6 +- .../preprocessing/sequence_test.py | 2 +- {keras => tf_keras}/preprocessing/text.py | 8 +- .../preprocessing/text_test.py | 2 +- {keras => tf_keras}/protobuf/BUILD | 6 +- .../protobuf/projector_config.proto | 2 +- .../protobuf/saved_metadata.proto | 16 +- {keras => tf_keras}/protobuf/versions.proto | 4 +- {keras => tf_keras}/regularizers.py | 18 +- {keras => tf_keras}/regularizers_test.py | 12 +- {keras => tf_keras}/saving/BUILD | 94 ++--- {keras => tf_keras}/saving/__init__.py | 0 {keras => tf_keras}/saving/legacy/__init__.py | 0 .../saving/legacy/hdf5_format.py | 46 +-- .../legacy/losses_serialization_test.py | 16 +- .../legacy/metrics_serialization_test.py | 16 +- .../saving/legacy/model_config.py | 14 +- {keras => tf_keras}/saving/legacy/save.py | 36 +- .../saving/legacy/save_test.py | 40 +-- .../saving/legacy/save_weights_test.py | 12 +- .../saving/legacy/saved_model/BUILD | 41 ++- .../saving/legacy/saved_model/README.md | 26 +- .../saving/legacy/saved_model/__init__.py | 0 .../legacy/saved_model/base_serialization.py | 6 +- .../saving/legacy/saved_model/constants.py | 6 +- .../saved_model/create_test_saved_model.py | 4 +- .../legacy/saved_model/determinism_test.py | 0 .../saving/legacy/saved_model/json_utils.py | 10 +- .../legacy/saved_model/json_utils_test.py | 6 +- .../legacy/saved_model/layer_serialization.py | 12 +- .../saving/legacy/saved_model/load.py | 86 ++--- .../saving/legacy/saved_model/load_context.py | 0 .../saved_model/metric_serialization.py | 6 +- .../legacy/saved_model/model_serialization.py | 8 +- .../saved_model/network_serialization.py | 4 +- .../saved_model/order_preserving_set.py | 0 .../saving/legacy/saved_model/revive_test.py | 14 +- .../saving/legacy/saved_model/save.py | 30 +- .../saving/legacy/saved_model/save_impl.py | 52 +-- .../legacy/saved_model/saved_model_test.py | 40 +-- .../saved_model/serialized_attributes.py | 34 +- .../saving/legacy/saved_model/utils.py | 16 +- .../saving/legacy/saving_utils.py | 44 +-- .../saving/legacy/saving_utils_test.py | 16 +- .../saving/legacy/serialization.py | 24 +- .../saving/object_registration.py | 22 +- .../saving/object_registration_test.py | 8 +- {keras => tf_keras}/saving/pickle_utils.py | 8 +- .../saving/pickle_utils_test.py | 6 +- {keras => tf_keras}/saving/saving_api.py | 34 +- {keras => tf_keras}/saving/saving_lib.py | 44 ++- {keras => tf_keras}/saving/saving_lib_test.py | 18 +- .../saving/serialization_lib.py | 44 +-- .../saving/serialization_lib_test.py | 10 +- {keras => tf_keras}/testing_infra/BUILD | 34 +- {keras => tf_keras}/testing_infra/__init__.py | 0 .../testing_infra/keras_doctest_lib.py | 2 +- .../testing_infra/keras_doctest_lib_test.py | 2 +- .../testing_infra/test_combinations.py | 44 +-- .../testing_infra/test_combinations_test.py | 10 +- .../testing_infra/test_utils.py | 54 +-- {keras => tf_keras}/tests/BUILD | 172 ++++----- {keras => tf_keras}/tests/__init__.py | 0 .../tests/add_loss_correctness_test.py | 16 +- .../automatic_outside_compilation_test.py | 22 +- .../tests/convert_to_constants_test.py | 10 +- .../tests/custom_training_loop_test.py | 6 +- .../tests/get_config_samples.py | 0 {keras => tf_keras}/tests/get_config_test.py | 8 +- {keras => tf_keras}/tests/graph_util_test.py | 8 +- {keras => tf_keras}/tests/integration_test.py | 14 +- {keras => tf_keras}/tests/keras_doctest.py | 2 +- .../tests/memory_checker_test.py | 2 +- {keras => tf_keras}/tests/memory_test.py | 2 +- .../tests/model_architectures.py | 2 +- .../tests/model_architectures_test.py | 10 +- .../tests/model_subclassing_compiled_test.py | 8 +- .../tests/model_subclassing_test.py | 8 +- .../tests/model_subclassing_test_util.py | 4 +- {keras => tf_keras}/tests/saved_model_test.py | 4 +- {keras => tf_keras}/tests/saver_test.py | 4 +- .../tests/serialization_util_test.py | 12 +- ...emporal_sample_weights_correctness_test.py | 12 +- {keras => tf_keras}/tests/tracking_test.py | 10 +- .../tests/tracking_util_test.py | 16 +- .../tracking_util_with_v1_optimizers_test.py | 8 +- .../tests/tracking_util_xla_test.py | 6 +- keras/keras.bzl => tf_keras/tf_keras.bzl | 2 +- {keras => tf_keras}/tools/bazel_build.sh | 0 {keras => tf_keras}/tools/gpu_build/BUILD | 0 .../tools/gpu_build/parallel_gpu_execute.sh | 0 tf_keras/tools/pip_package/BUILD | 44 +++ .../tools/pip_package/build_pip_package.sh | 0 .../tools/pip_package/create_pip_helper.py | 27 +- .../tools/pip_package/setup.py | 8 +- {keras => tf_keras}/utils/BUILD | 153 ++++---- tf_keras/utils/__init__.py | 74 ++++ {keras => tf_keras}/utils/audio_dataset.py | 2 +- .../utils/audio_dataset_test.py | 6 +- .../utils/audio_dataset_with_tfio_test.py | 6 +- .../utils/composite_tensor_support_test.py | 20 +- .../utils/control_flow_util.py | 0 {keras => tf_keras}/utils/conv_utils.py | 2 +- {keras => tf_keras}/utils/conv_utils_test.py | 2 +- {keras => tf_keras}/utils/data_utils.py | 12 +- {keras => tf_keras}/utils/data_utils_test.py | 4 +- {keras => tf_keras}/utils/dataset_creator.py | 0 .../utils/dataset_creator_test.py | 16 +- {keras => tf_keras}/utils/dataset_utils.py | 2 +- .../utils/dataset_utils_test.py | 4 +- {keras => tf_keras}/utils/feature_space.py | 26 +- .../utils/feature_space_test.py | 10 +- {keras => tf_keras}/utils/generic_utils.py | 6 +- .../utils/generic_utils_test.py | 14 +- {keras => tf_keras}/utils/image_dataset.py | 4 +- .../utils/image_dataset_test.py | 8 +- {keras => tf_keras}/utils/image_utils.py | 6 +- {keras => tf_keras}/utils/image_utils_test.py | 6 +- {keras => tf_keras}/utils/io_utils.py | 10 +- {keras => tf_keras}/utils/io_utils_test.py | 4 +- {keras => tf_keras}/utils/keras_logging.py | 0 {keras => tf_keras}/utils/kernelized_utils.py | 0 .../utils/kernelized_utils_test.py | 2 +- {keras => tf_keras}/utils/kpl_test_utils.py | 4 +- {keras => tf_keras}/utils/layer_utils.py | 10 +- {keras => tf_keras}/utils/layer_utils_test.py | 20 +- {keras => tf_keras}/utils/legacy/__init__.py | 6 +- {keras => tf_keras}/utils/losses_utils.py | 8 +- .../utils/losses_utils_test.py | 4 +- {keras => tf_keras}/utils/metrics_utils.py | 12 +- .../utils/metrics_utils_test.py | 8 +- {keras => tf_keras}/utils/mode_keys.py | 0 {keras => tf_keras}/utils/np_utils.py | 0 {keras => tf_keras}/utils/np_utils_test.py | 4 +- {keras => tf_keras}/utils/object_identity.py | 0 .../utils/sidecar_evaluator.py | 16 +- .../utils/sidecar_evaluator_test.py | 14 +- .../utils/steps_per_execution_tuning.py | 2 +- .../utils/steps_per_execution_tuning_test.py | 14 +- {keras => tf_keras}/utils/text_dataset.py | 2 +- .../utils/text_dataset_test.py | 6 +- {keras => tf_keras}/utils/tf_contextlib.py | 0 {keras => tf_keras}/utils/tf_inspect.py | 0 {keras => tf_keras}/utils/tf_utils.py | 20 +- {keras => tf_keras}/utils/tf_utils_test.py | 10 +- {keras => tf_keras}/utils/timed_threads.py | 0 .../utils/timed_threads_test.py | 8 +- .../utils/timeseries_dataset.py | 0 .../utils/timeseries_dataset_test.py | 4 +- {keras => tf_keras}/utils/traceback_utils.py | 2 +- .../utils/traceback_utils_test.py | 4 +- {keras => tf_keras}/utils/version_utils.py | 24 +- .../utils/version_utils_test.py | 14 +- {keras => tf_keras}/utils/vis_utils.py | 24 +- {keras => tf_keras}/utils/vis_utils_test.py | 12 +- 1702 files changed, 10494 insertions(+), 10331 deletions(-) delete mode 100644 keras/api/BUILD delete mode 100644 keras/api/api_gen.bzl delete mode 100644 keras/api/create_python_api_wrapper.py delete mode 100644 keras/applications/__init__.py delete mode 100644 keras/benchmarks/README.md delete mode 100644 keras/distribute/README.md delete mode 100644 keras/layers/__init__.py delete mode 100644 keras/layers/convolutional/BUILD delete mode 100644 keras/layers/convolutional/__init__.py delete mode 100644 keras/layers/core/__init__.py delete mode 100644 keras/layers/merging/__init__.py delete mode 100644 keras/layers/pooling/__init__.py delete mode 100644 keras/layers/reshaping/__init__.py delete mode 100644 keras/layers/rnn/__init__.py delete mode 100644 keras/legacy_tf_layers/__init__.py delete mode 100644 keras/metrics/__init__.py delete mode 100644 keras/models/__init__.py delete mode 100644 keras/opensource_only.files delete mode 100644 keras/optimizers/schedules/BUILD delete mode 100644 keras/tools/pip_package/BUILD delete mode 100644 keras/utils/__init__.py rename {keras => tf_keras}/BUILD (68%) rename {keras => tf_keras}/__init__.py (78%) rename {keras => tf_keras}/activations.py (98%) rename {keras => tf_keras}/activations_test.py (97%) create mode 100644 tf_keras/api/BUILD create mode 100644 tf_keras/api/api_gen.bzl rename {keras => tf_keras}/api/api_init_files.bzl (100%) create mode 100644 tf_keras/api/extractor_wrapper.py create mode 100644 tf_keras/api/generator_wrapper.py rename {keras => tf_keras}/api/golden/BUILD (79%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.-model.pbtxt (98%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.-sequential.pbtxt (97%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.layers.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling1-d.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling2-d.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling3-d.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-batch-normalization.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv1-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d-transpose.pbtxt (92%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d-transpose.pbtxt (92%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dense.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dropout.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-flatten.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-input-spec.pbtxt (91%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-layer.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling1-d.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling2-d.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling3-d.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv1-d.pbtxt (92%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv2-d.pbtxt (92%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.experimental.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-l-s-t-m-cell.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-r-n-n-cell.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-device-wrapper.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-dropout-wrapper.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-g-r-u-cell.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-cell.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-state-tuple.pbtxt (73%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-multi-r-n-n-cell.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-r-n-n-cell.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-residual-wrapper.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.__internal__.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.activations.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.convnext.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.densenet.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.efficientnet.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.efficientnet_v2.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.imagenet_utils.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.inception_resnet_v2.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.inception_v3.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.mobilenet.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.mobilenet_v2.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.mobilenet_v3.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.nasnet.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.regnet.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.resnet.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.resnet50.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.resnet_rs.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.resnet_v2.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.vgg16.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.vgg19.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.applications.xception.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.backend.name_scope.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.backend.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.callbacks.-base-logger.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.callbacks.-callback-list.pbtxt (98%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.callbacks.-callback.pbtxt (98%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.callbacks.-early-stopping.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.callbacks.-history.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.callbacks.-lambda-callback.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.callbacks.-model-checkpoint.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.callbacks.-progbar-logger.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.callbacks.-remote-monitor.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.callbacks.-tensor-board.pbtxt (92%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.callbacks.pbtxt (100%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.constraints.-constraint.pbtxt (86%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.constraints.-max-norm.pbtxt (80%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.constraints.-min-max-norm.pbtxt (81%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.constraints.-non-neg.pbtxt (76%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.constraints.-radial-constraint.pbtxt (75%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.constraints.-unit-norm.pbtxt (79%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.constraints.max_norm.pbtxt (80%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.constraints.min_max_norm.pbtxt (81%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.constraints.non_neg.pbtxt (76%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.constraints.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.constraints.radial_constraint.pbtxt (75%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.constraints.unit_norm.pbtxt (80%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.datasets.boston_housing.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.datasets.cifar10.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.datasets.cifar100.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.datasets.fashion_mnist.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.datasets.imdb.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.datasets.mnist.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.datasets.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.datasets.reuters.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.estimator.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt (74%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.experimental.-cosine-decay.pbtxt (75%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.experimental.-linear-model.pbtxt (97%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.experimental.-sequence-features.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.experimental.-wide-deep-model.pbtxt (97%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.experimental.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.export.-export-archive.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.export.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.-constant.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.-identity.pbtxt (100%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.initializers.-initializer.pbtxt (83%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.-ones.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.-orthogonal.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.-random-normal.pbtxt (89%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.-random-uniform.pbtxt (89%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.-truncated-normal.pbtxt (89%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.-variance-scaling.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.-zeros.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.constant.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.glorot_normal.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.glorot_uniform.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.he_normal.pbtxt (89%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.he_uniform.pbtxt (89%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.identity.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.lecun_normal.pbtxt (88%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.lecun_uniform.pbtxt (88%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.normal.pbtxt (89%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.ones.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.orthogonal.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.random_normal.pbtxt (89%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.random_uniform.pbtxt (89%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.truncated_normal.pbtxt (89%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.uniform.pbtxt (89%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.initializers.zeros.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-activation.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-activity-regularization.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-add.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-additive-attention.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-alpha-dropout.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-attention.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-average-pooling1-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-average-pooling2-d.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-average-pooling3-d.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-average.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-avg-pool1-d.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-avg-pool2-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-avg-pool3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-batch-normalization.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-bidirectional.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-category-encoding.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-center-crop.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-concatenate.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-conv1-d-transpose.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-conv1-d.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-conv2-d-transpose.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-conv2-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-conv3-d-transpose.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-conv3-d.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-convolution1-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-convolution2-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-convolution3-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-cropping1-d.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-cropping2-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-cropping3-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-g-r-u.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-l-s-t-m.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-dense-features.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-dense.pbtxt (97%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-discretization.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-dot.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-dropout.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-e-l-u.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-einsum-dense.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-embedding.pbtxt (97%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-flatten.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-g-r-u-cell.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-g-r-u.pbtxt (97%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-gaussian-dropout.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-gaussian-noise.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-global-max-pool1-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-global-max-pool2-d.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-global-max-pool3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-hashing.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-identity.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-input-layer.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-input-spec.pbtxt (90%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-l-s-t-m.pbtxt (97%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-lambda.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-layer-normalization.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-layer.pbtxt (97%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-leaky-re-l-u.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-locally-connected1-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-locally-connected2-d.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-masking.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-max-pool1-d.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-max-pool2-d.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-max-pool3-d.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-max-pooling1-d.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-max-pooling2-d.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-max-pooling3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-maximum.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-minimum.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-multi-head-attention.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-multiply.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-normalization.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-p-re-l-u.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-permute.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-r-n-n.pbtxt (97%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-re-l-u.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-repeat-vector.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-rescaling.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-reshape.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-resizing.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-separable-conv1-d.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-separable-conv2-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-separable-convolution1-d.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-separable-convolution2-d.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-simple-r-n-n.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-softmax.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-subtract.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.-time-distributed.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-up-sampling1-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-up-sampling2-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-up-sampling3-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-wrapper.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-zero-padding1-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-zero-padding2-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.-zero-padding3-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.experimental.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.layers.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.losses.-binary-crossentropy.pbtxt (80%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt (81%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.losses.-categorical-crossentropy.pbtxt (80%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt (80%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.losses.-categorical-hinge.pbtxt (78%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.losses.-cosine-similarity.pbtxt (79%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.losses.-hinge.pbtxt (79%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.losses.-huber.pbtxt (79%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.losses.-k-l-divergence.pbtxt (79%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.losses.-log-cosh.pbtxt (79%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.losses.-loss.pbtxt (92%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.losses.-mean-absolute-error.pbtxt (78%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt (78%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.losses.-mean-squared-error.pbtxt (78%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt (78%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.losses.-poisson.pbtxt (79%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt (79%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.losses.-squared-hinge.pbtxt (79%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.losses.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-a-u-c.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-accuracy.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-binary-accuracy.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-binary-crossentropy.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-binary-io-u.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-categorical-accuracy.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-categorical-hinge.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-cosine-similarity.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-f-beta-score.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-f1-score.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-false-negatives.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-false-positives.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-hinge.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-io-u.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-k-l-divergence.pbtxt (93%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-log-cosh-error.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-mean-absolute-error.pbtxt (93%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-mean-io-u.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-mean-relative-error.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-mean-squared-error.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-mean-tensor.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-mean.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-metric.pbtxt (97%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-one-hot-io-u.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-poisson.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-precision-at-recall.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-precision.pbtxt (96%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-r2-score.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-recall-at-precision.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-recall.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt (93%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt (93%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-squared-hinge.pbtxt (93%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-sum.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt (93%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-true-negatives.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.metrics.-true-positives.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.metrics.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt (89%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.mixed_precision.pbtxt (50%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.models.-linear-model.pbtxt (97%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.models.-model.pbtxt (98%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.models.-sequential.pbtxt (97%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.models.-wide-deep-model.pbtxt (97%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.models.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.-adadelta.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.-adagrad.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.-adam.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.-adamax.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.-ftrl.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.-nadam.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.-optimizer.pbtxt (97%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.-r-m-sprop.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.-s-g-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt (94%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.optimizers.legacy.-adam.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.optimizers.legacy.-adamax.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.optimizers.legacy.-nadam.pbtxt (95%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt (97%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt (95%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.legacy.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt (74%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt (75%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt (74%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt (74%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt (79%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt (71%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt (75%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.optimizers.schedules.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.pbtxt (100%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt (85%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt (97%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.preprocessing.image.-iterator.pbtxt (84%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt (82%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.preprocessing.image.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.preprocessing.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt (84%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.preprocessing.sequence.pbtxt (100%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt (96%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.preprocessing.text.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.regularizers.-l1-l2.pbtxt (80%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.regularizers.-l1.pbtxt (80%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.regularizers.-l2.pbtxt (80%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.regularizers.-regularizer.pbtxt (86%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.regularizers.l1.pbtxt (80%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.regularizers.l2.pbtxt (80%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.regularizers.pbtxt (100%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.saving.custom_object_scope.pbtxt (72%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.saving.pbtxt (100%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.utils.-custom-object-scope.pbtxt (72%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.utils.-deterministic-random-test-tool.pbtxt (82%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.utils.-generator-enqueuer.pbtxt (84%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.utils.-ordered-enqueuer.pbtxt (85%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.utils.-progbar.pbtxt (90%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.utils.-sequence-enqueuer.pbtxt (91%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.utils.-sequence.pbtxt (79%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt (87%) rename {keras/api/golden/v2 => tf_keras/api/golden/v1}/tensorflow.keras.utils.custom_object_scope.pbtxt (72%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.utils.legacy.pbtxt (100%) rename {keras => tf_keras}/api/golden/v1/tensorflow.keras.utils.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.-model.pbtxt (98%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.-sequential.pbtxt (97%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.__internal__.-keras-tensor.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.__internal__.-ragged-keras-tensor.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.__internal__.-sparse-keras-tensor.pbtxt (92%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.__internal__.backend.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.__internal__.layers.-base-dense-attention.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.__internal__.layers.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.__internal__.losses.-loss-function-wrapper.pbtxt (85%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.__internal__.losses.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.__internal__.models.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.__internal__.optimizers.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.__internal__.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.__internal__.utils.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.activations.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.convnext.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.densenet.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.efficientnet.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.efficientnet_v2.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.imagenet_utils.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.inception_resnet_v2.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.inception_v3.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.mobilenet.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.mobilenet_v2.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.mobilenet_v3.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.nasnet.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.regnet.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.resnet.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.resnet50.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.resnet_rs.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.resnet_v2.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.vgg16.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.vgg19.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.applications.xception.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.backend.experimental.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.backend.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.-backup-and-restore.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.-base-logger.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.-callback-list.pbtxt (98%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.callbacks.-callback.pbtxt (98%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.-early-stopping.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.callbacks.-history.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.-lambda-callback.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.-model-checkpoint.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.-progbar-logger.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.-remote-monitor.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.-tensor-board.pbtxt (93%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.experimental.-backup-and-restore.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.experimental.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.callbacks.pbtxt (100%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.constraints.-constraint.pbtxt (86%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.constraints.-max-norm.pbtxt (80%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.constraints.-min-max-norm.pbtxt (81%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.constraints.-non-neg.pbtxt (76%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.constraints.-radial-constraint.pbtxt (75%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.constraints.-unit-norm.pbtxt (79%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.constraints.max_norm.pbtxt (80%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.constraints.min_max_norm.pbtxt (81%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.constraints.non_neg.pbtxt (76%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.constraints.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.constraints.radial_constraint.pbtxt (75%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.constraints.unit_norm.pbtxt (80%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.datasets.boston_housing.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.datasets.cifar10.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.datasets.cifar100.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.datasets.fashion_mnist.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.datasets.imdb.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.datasets.mnist.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.datasets.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.datasets.reuters.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.dtensor.experimental.-layout-map.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adadelta.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adagrad.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam-w.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-r-m-sprop.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-s-g-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.dtensor.experimental.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.dtensor.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.estimator.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt (74%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.experimental.-cosine-decay.pbtxt (75%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.experimental.-linear-model.pbtxt (97%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.experimental.-sequence-features.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.experimental.-sidecar-evaluator.pbtxt (66%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.experimental.-wide-deep-model.pbtxt (97%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.experimental.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.export.-export-archive.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.export.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.google.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-constant.pbtxt (76%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-glorot-normal.pbtxt (67%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-glorot-uniform.pbtxt (67%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-he-normal.pbtxt (67%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-he-uniform.pbtxt (67%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-identity.pbtxt (76%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.initializers.-initializer.pbtxt (83%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-lecun-normal.pbtxt (67%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-lecun-uniform.pbtxt (67%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-ones.pbtxt (72%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-orthogonal.pbtxt (76%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-random-normal.pbtxt (77%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-random-uniform.pbtxt (77%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-truncated-normal.pbtxt (77%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-variance-scaling.pbtxt (78%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.-zeros.pbtxt (72%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.constant.pbtxt (76%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.glorot_normal.pbtxt (67%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.glorot_uniform.pbtxt (67%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.he_normal.pbtxt (67%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.he_uniform.pbtxt (67%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.identity.pbtxt (76%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.lecun_normal.pbtxt (67%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.lecun_uniform.pbtxt (67%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.ones.pbtxt (72%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.orthogonal.pbtxt (76%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.random_normal.pbtxt (77%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.random_uniform.pbtxt (77%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.truncated_normal.pbtxt (77%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.variance_scaling.pbtxt (78%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.initializers.zeros.pbtxt (72%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-activation.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-activity-regularization.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-add.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-additive-attention.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-alpha-dropout.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-attention.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-average-pooling1-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-average-pooling2-d.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-average-pooling3-d.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-average.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-avg-pool1-d.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-avg-pool2-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-avg-pool3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-batch-normalization.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-bidirectional.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-category-encoding.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-center-crop.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-concatenate.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-conv1-d-transpose.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-conv1-d.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-conv2-d-transpose.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-conv2-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-conv3-d-transpose.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-conv3-d.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-convolution1-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-convolution2-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-convolution3-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-cropping1-d.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-cropping2-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-cropping3-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-dense-features.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-dense.pbtxt (97%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-discretization.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-dot.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-dropout.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-e-l-u.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-einsum-dense.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-embedding.pbtxt (97%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-flatten.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-g-r-u-cell.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-g-r-u.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-gaussian-dropout.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-gaussian-noise.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-global-max-pool1-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-global-max-pool2-d.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-global-max-pool3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-group-normalization.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-hashed-crossing.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-hashing.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-identity.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-input-layer.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-input-spec.pbtxt (90%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-integer-lookup.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-l-s-t-m.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-lambda.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-layer-normalization.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-layer.pbtxt (97%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-leaky-re-l-u.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-locally-connected1-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-locally-connected2-d.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-masking.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-max-pool1-d.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-max-pool2-d.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-max-pool3-d.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-max-pooling1-d.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-max-pooling2-d.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-max-pooling3-d.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-maximum.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-minimum.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-multi-head-attention.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-multiply.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-normalization.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-p-re-l-u.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-permute.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-r-n-n.pbtxt (97%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-random-brightness.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-random-contrast.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-random-crop.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-random-flip.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-random-height.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-random-rotation.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-random-translation.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-random-width.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-random-zoom.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-re-l-u.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-repeat-vector.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-rescaling.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-reshape.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-resizing.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-separable-conv1-d.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-separable-conv2-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-separable-convolution1-d.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-separable-convolution2-d.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-simple-r-n-n.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-softmax.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-spectral-normalization.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-string-lookup.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-subtract.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-text-vectorization.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.-time-distributed.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-unit-normalization.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-up-sampling1-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-up-sampling2-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-up-sampling3-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-wrapper.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-zero-padding1-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-zero-padding2-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.-zero-padding3-d.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.-sync-batch-normalization.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashed-crossing.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-integer-lookup.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-contrast.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-crop.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-flip.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-height.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-rotation.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-translation.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-width.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-zoom.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-string-lookup.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-text-vectorization.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.layers.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.losses.-binary-crossentropy.pbtxt (80%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt (81%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.losses.-categorical-crossentropy.pbtxt (80%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt (80%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.losses.-categorical-hinge.pbtxt (78%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.losses.-cosine-similarity.pbtxt (79%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.losses.-hinge.pbtxt (79%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.losses.-huber.pbtxt (79%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.losses.-k-l-divergence.pbtxt (79%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.losses.-log-cosh.pbtxt (79%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.losses.-loss.pbtxt (92%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.losses.-mean-absolute-error.pbtxt (78%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt (78%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.losses.-mean-squared-error.pbtxt (78%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt (78%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.losses.-poisson.pbtxt (79%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.losses.-reduction.pbtxt (90%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt (79%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.losses.-squared-hinge.pbtxt (79%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.losses.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-a-u-c.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-accuracy.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-binary-accuracy.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-binary-crossentropy.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-binary-io-u.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-categorical-accuracy.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-categorical-hinge.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-cosine-similarity.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-f-beta-score.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-f1-score.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-false-negatives.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-false-positives.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-hinge.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-io-u.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-k-l-divergence.pbtxt (93%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-log-cosh-error.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-mean-absolute-error.pbtxt (93%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-mean-io-u.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-mean-relative-error.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-mean-squared-error.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-mean-tensor.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-mean.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-metric.pbtxt (97%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-one-hot-io-u.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-poisson.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-precision-at-recall.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-precision.pbtxt (96%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-r2-score.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-recall-at-precision.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-recall.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt (93%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt (93%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-squared-hinge.pbtxt (93%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-sum.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt (93%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-true-negatives.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.metrics.-true-positives.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.experimental.-py-metric.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.experimental.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.metrics.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt (89%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.mixed_precision.-policy.pbtxt (91%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.mixed_precision.pbtxt (80%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.models.-model.pbtxt (98%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.models.-sequential.pbtxt (97%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.models.experimental.-sharpness-aware-minimization.pbtxt (97%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.models.experimental.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.models.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.-adadelta.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.-adafactor.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.-adagrad.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.-adam-w.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.-adam.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.-adamax.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.-ftrl.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.-lion.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.-nadam.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.-optimizer.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.-r-m-sprop.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.-s-g-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.experimental.-adadelta.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.experimental.-adafactor.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.experimental.-adagrad.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam-w.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.experimental.-adamax.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.experimental.-ftrl.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.experimental.-nadam.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.experimental.-optimizer.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.experimental.-r-m-sprop.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.experimental.-s-g-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.experimental.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt (94%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.optimizers.legacy.-adam.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.optimizers.legacy.-adamax.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.optimizers.legacy.-nadam.pbtxt (95%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt (97%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt (95%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt (94%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.legacy.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt (74%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt (75%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt (74%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt (74%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt (79%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt (71%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt (75%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.optimizers.schedules.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.pbtxt (100%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt (85%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt (97%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.preprocessing.image.-iterator.pbtxt (84%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt (82%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.preprocessing.image.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.preprocessing.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt (84%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.preprocessing.sequence.pbtxt (100%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt (96%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.preprocessing.text.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.regularizers.-l1-l2.pbtxt (80%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.regularizers.-l1.pbtxt (80%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.regularizers.-l2.pbtxt (80%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.regularizers.-orthogonal-regularizer.pbtxt (79%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.regularizers.-regularizer.pbtxt (86%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.regularizers.l1.pbtxt (80%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.regularizers.l2.pbtxt (80%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.regularizers.orthogonal_regularizer.pbtxt (79%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.regularizers.pbtxt (100%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.saving.custom_object_scope.pbtxt (72%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.saving.pbtxt (100%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.utils.-custom-object-scope.pbtxt (72%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.utils.-feature-space.pbtxt (97%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.utils.-generator-enqueuer.pbtxt (84%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.utils.-ordered-enqueuer.pbtxt (85%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.utils.-progbar.pbtxt (90%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.utils.-sequence-enqueuer.pbtxt (91%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.utils.-sequence.pbtxt (79%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.utils.-sidecar-evaluator.pbtxt (84%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt (87%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.utils.-timed-thread.pbtxt (90%) rename {keras/api/golden/v1 => tf_keras/api/golden/v2}/tensorflow.keras.utils.custom_object_scope.pbtxt (72%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.utils.experimental.-dataset-creator.pbtxt (78%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.utils.experimental.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.utils.legacy.pbtxt (100%) rename {keras => tf_keras}/api/golden/v2/tensorflow.keras.utils.pbtxt (100%) rename {keras => tf_keras}/api/tests/API_UPDATE_WARNING.txt (100%) rename {keras => tf_keras}/api/tests/BUILD (68%) rename {keras => tf_keras}/api/tests/README.txt (100%) rename {keras => tf_keras}/api/tests/api_compatibility_test.py (99%) rename {keras => tf_keras}/applications/BUILD (76%) create mode 100644 tf_keras/applications/__init__.py rename {keras => tf_keras}/applications/applications_load_weight_test.py (87%) rename {keras => tf_keras}/applications/applications_test.py (90%) rename {keras => tf_keras}/applications/convnext.py (97%) rename {keras => tf_keras}/applications/densenet.py (95%) rename {keras => tf_keras}/applications/efficientnet.py (98%) rename {keras => tf_keras}/applications/efficientnet_v2.py (98%) rename {keras => tf_keras}/applications/imagenet_utils.py (99%) rename {keras => tf_keras}/applications/imagenet_utils_test.py (98%) rename {keras => tf_keras}/applications/inception_resnet_v2.py (96%) rename {keras => tf_keras}/applications/inception_v3.py (96%) rename {keras => tf_keras}/applications/mobilenet.py (97%) rename {keras => tf_keras}/applications/mobilenet_v2.py (97%) rename {keras => tf_keras}/applications/mobilenet_v3.py (98%) rename {keras => tf_keras}/applications/nasnet.py (96%) rename {keras => tf_keras}/applications/regnet.py (99%) rename {keras => tf_keras}/applications/resnet.py (97%) rename {keras => tf_keras}/applications/resnet_rs.py (98%) rename {keras => tf_keras}/applications/resnet_v2.py (95%) rename {keras => tf_keras}/applications/vgg16.py (96%) rename {keras => tf_keras}/applications/vgg19.py (96%) rename {keras => tf_keras}/applications/xception.py (97%) rename {keras => tf_keras}/backend.py (98%) rename {keras => tf_keras}/backend_config.py (98%) rename {keras => tf_keras}/backend_config_test.py (94%) rename {keras => tf_keras}/backend_test.py (99%) rename {keras => tf_keras}/benchmarks/BUILD (84%) create mode 100644 tf_keras/benchmarks/README.md rename {keras => tf_keras}/benchmarks/__init__.py (100%) rename {keras => tf_keras}/benchmarks/benchmark_util.py (98%) rename {keras => tf_keras}/benchmarks/benchmark_util_test.py (97%) rename {keras => tf_keras}/benchmarks/distribution_util.py (100%) rename {keras => tf_keras}/benchmarks/eager_microbenchmarks_test.py (98%) rename {keras => tf_keras}/benchmarks/keras_cpu_benchmark_test.py (97%) rename {keras => tf_keras}/benchmarks/keras_examples_benchmarks/BUILD (67%) rename {keras => tf_keras}/benchmarks/keras_examples_benchmarks/README.md (88%) rename {keras => tf_keras}/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py (99%) rename {keras => tf_keras}/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py (99%) rename {keras => tf_keras}/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py (97%) rename {keras => tf_keras}/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py (99%) rename {keras => tf_keras}/benchmarks/keras_examples_benchmarks/mnist_conv_custom_training_benchmark_test.py (99%) rename {keras => tf_keras}/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py (97%) rename {keras => tf_keras}/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py (98%) rename {keras => tf_keras}/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py (97%) rename {keras => tf_keras}/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py (98%) rename {keras => tf_keras}/benchmarks/layer_benchmarks/BUILD (83%) rename {keras => tf_keras}/benchmarks/layer_benchmarks/layer_benchmarks_test.py (98%) rename {keras => tf_keras}/benchmarks/layer_benchmarks/layer_benchmarks_test_base.py (95%) rename {keras => tf_keras}/benchmarks/layer_benchmarks/run_xprof.py (100%) rename {keras => tf_keras}/benchmarks/metrics_memory_benchmark_test.py (97%) rename {keras => tf_keras}/benchmarks/model_components_benchmarks_test.py (99%) rename {keras => tf_keras}/benchmarks/model_memory_profile.py (97%) rename {keras => tf_keras}/benchmarks/optimizer_benchmarks_test.py (95%) rename {keras => tf_keras}/benchmarks/saved_model_benchmarks/BUILD (78%) rename {keras => tf_keras}/benchmarks/saved_model_benchmarks/densenet_benchmark_test.py (94%) rename {keras => tf_keras}/benchmarks/saved_model_benchmarks/efficientnet_benchmark_test.py (95%) rename {keras => tf_keras}/benchmarks/saved_model_benchmarks/inception_resnet_v2_benchmark_test.py (95%) rename {keras => tf_keras}/benchmarks/saved_model_benchmarks/mobilenet_benchmark_test.py (94%) rename {keras => tf_keras}/benchmarks/saved_model_benchmarks/nasnet_large_benchmark_test.py (94%) rename {keras => tf_keras}/benchmarks/saved_model_benchmarks/resnet152_v2_benchmark_test.py (94%) rename {keras => tf_keras}/benchmarks/saved_model_benchmarks/saved_model_benchmark_util.py (98%) rename {keras => tf_keras}/benchmarks/saved_model_benchmarks/vgg_benchmark_test.py (94%) rename {keras => tf_keras}/benchmarks/saved_model_benchmarks/xception_benchmark_test.py (94%) rename {keras => tf_keras}/callbacks.py (98%) rename {keras => tf_keras}/callbacks_test.py (99%) rename {keras => tf_keras}/callbacks_v1.py (99%) rename {keras => tf_keras}/callbacks_v1_test.py (98%) rename {keras => tf_keras}/constraints.py (97%) rename {keras => tf_keras}/constraints_test.py (96%) rename {keras => tf_keras}/datasets/BUILD (68%) rename {keras => tf_keras}/datasets/__init__.py (100%) rename {keras => tf_keras}/datasets/boston_housing.py (98%) rename {keras => tf_keras}/datasets/cifar.py (100%) rename {keras => tf_keras}/datasets/cifar10.py (96%) rename {keras => tf_keras}/datasets/cifar100.py (96%) rename {keras => tf_keras}/datasets/fashion_mnist.py (98%) rename {keras => tf_keras}/datasets/imdb.py (98%) rename {keras => tf_keras}/datasets/mnist.py (98%) rename {keras => tf_keras}/datasets/reuters.py (97%) rename {keras => tf_keras}/distribute/BUILD (84%) create mode 100644 tf_keras/distribute/README.md rename {keras => tf_keras}/distribute/__init__.py (100%) rename {keras => tf_keras}/distribute/checkpointing_test.py (99%) rename {keras => tf_keras}/distribute/collective_all_reduce_strategy_test.py (93%) rename {keras => tf_keras}/distribute/ctl_correctness_test.py (98%) rename {keras => tf_keras}/distribute/custom_training_loop_metrics_test.py (98%) rename {keras => tf_keras}/distribute/custom_training_loop_models_test.py (99%) rename {keras => tf_keras}/distribute/custom_training_loop_optimizer_test.py (98%) rename {keras => tf_keras}/distribute/dataset_creator_model_fit_ps_only_test.py (96%) rename {keras => tf_keras}/distribute/dataset_creator_model_fit_test.py (98%) rename {keras => tf_keras}/distribute/dataset_creator_model_fit_test_base.py (96%) rename {keras => tf_keras}/distribute/distribute_coordinator_utils.py (100%) rename {keras => tf_keras}/distribute/distribute_strategy_test.py (99%) rename {keras => tf_keras}/distribute/distributed_file_utils.py (100%) rename {keras => tf_keras}/distribute/distributed_file_utils_test.py (99%) rename {keras => tf_keras}/distribute/distributed_training_utils.py (99%) rename {keras => tf_keras}/distribute/distributed_training_utils_test.py (90%) rename {keras => tf_keras}/distribute/distributed_training_utils_v1.py (98%) rename {keras => tf_keras}/distribute/keras_correctness_test_base.py (97%) rename {keras => tf_keras}/distribute/keras_dnn_correctness_test.py (97%) rename {keras => tf_keras}/distribute/keras_embedding_model_correctness_test.py (97%) rename {keras => tf_keras}/distribute/keras_image_model_correctness_test.py (97%) rename {keras => tf_keras}/distribute/keras_metrics_test.py (99%) rename {keras => tf_keras}/distribute/keras_models_test.py (92%) rename {keras => tf_keras}/distribute/keras_optimizer_v2_test.py (97%) rename {keras => tf_keras}/distribute/keras_premade_models_test.py (95%) rename {keras => tf_keras}/distribute/keras_rnn_model_correctness_test.py (92%) rename {keras => tf_keras}/distribute/keras_save_load_test.py (95%) rename {keras => tf_keras}/distribute/keras_stateful_lstm_model_correctness_test.py (95%) rename {keras => tf_keras}/distribute/keras_utils_test.py (99%) rename {keras => tf_keras}/distribute/minimize_loss_test.py (99%) rename {keras => tf_keras}/distribute/mirrored_strategy_test.py (96%) rename {keras => tf_keras}/distribute/mirrored_variable_test.py (97%) rename {keras => tf_keras}/distribute/model_checkpoint_test.py (96%) rename {keras => tf_keras}/distribute/model_collection_base.py (100%) rename {keras => tf_keras}/distribute/model_combinations.py (96%) rename {keras => tf_keras}/distribute/multi_worker_callback_tf2_test.py (98%) rename {keras => tf_keras}/distribute/multi_worker_test.py (97%) rename {keras => tf_keras}/distribute/multi_worker_testing_utils.py (98%) rename {keras => tf_keras}/distribute/optimizer_combinations.py (90%) rename {keras => tf_keras}/distribute/parameter_server_evaluation_test.py (96%) rename {keras => tf_keras}/distribute/parameter_server_exact_evaluation_test.py (98%) rename {keras => tf_keras}/distribute/saved_model_mixed_api_test.py (95%) rename {keras => tf_keras}/distribute/saved_model_save_load_test.py (98%) rename {keras => tf_keras}/distribute/saved_model_test_base.py (99%) rename {keras => tf_keras}/distribute/sharded_variable_test.py (98%) rename {keras => tf_keras}/distribute/simple_models.py (96%) rename {keras => tf_keras}/distribute/strategy_combinations.py (100%) rename {keras => tf_keras}/distribute/test_example.py (95%) rename {keras => tf_keras}/distribute/tpu_strategy_test_utils.py (100%) rename {keras => tf_keras}/distribute/worker_training_state.py (98%) rename {keras => tf_keras}/distribute/worker_training_state_test.py (95%) rename {keras => tf_keras}/dtensor/BUILD (72%) rename {keras => tf_keras}/dtensor/__init__.py (100%) rename {keras => tf_keras}/dtensor/initializers_test.py (97%) rename {keras => tf_keras}/dtensor/integration_test_utils.py (94%) rename {keras => tf_keras}/dtensor/layers_test.py (96%) rename {keras => tf_keras}/dtensor/layout_map.py (97%) rename {keras => tf_keras}/dtensor/layout_map_test.py (98%) rename {keras => tf_keras}/dtensor/lazy_variable.py (99%) rename {keras => tf_keras}/dtensor/metrics_test.py (95%) rename {keras => tf_keras}/dtensor/mnist_model_test.py (93%) rename {keras => tf_keras}/dtensor/optimizers_test.py (94%) rename {keras => tf_keras}/dtensor/save_load_test.py (92%) rename {keras => tf_keras}/dtensor/strategy_integration_test.py (95%) rename {keras => tf_keras}/dtensor/test_util.py (100%) rename {keras => tf_keras}/dtensor/utils.py (95%) rename {keras => tf_keras}/dtensor/utils_test.py (95%) rename {keras => tf_keras}/engine/BUILD (61%) rename {keras => tf_keras}/engine/__init__.py (100%) rename {keras => tf_keras}/engine/base_layer.py (98%) rename {keras => tf_keras}/engine/base_layer_test.py (99%) rename {keras => tf_keras}/engine/base_layer_utils.py (95%) rename {keras => tf_keras}/engine/base_layer_utils_test.py (96%) rename {keras => tf_keras}/engine/base_layer_v1.py (98%) rename {keras => tf_keras}/engine/base_preprocessing_layer.py (98%) rename {keras => tf_keras}/engine/base_preprocessing_layer_test.py (98%) rename {keras => tf_keras}/engine/compile_utils.py (99%) rename {keras => tf_keras}/engine/compile_utils_test.py (99%) rename {keras => tf_keras}/engine/control_flow_test.py (93%) rename {keras => tf_keras}/engine/correctness_test.py (97%) rename {keras => tf_keras}/engine/data_adapter.py (99%) rename {keras => tf_keras}/engine/data_adapter_test.py (99%) rename {keras => tf_keras}/engine/deferred_sequential_test.py (98%) rename {keras => tf_keras}/engine/feature_columns_integration_test.py (97%) rename {keras => tf_keras}/engine/functional.py (97%) rename {keras => tf_keras}/engine/functional_test.py (99%) rename {keras => tf_keras}/engine/functional_utils.py (98%) rename {keras => tf_keras}/engine/functional_utils_test.py (97%) rename {keras => tf_keras}/engine/input_layer.py (93%) rename {keras => tf_keras}/engine/input_layer_test.py (94%) rename {keras => tf_keras}/engine/input_spec.py (99%) rename {keras => tf_keras}/engine/input_spec_test.py (98%) rename {keras => tf_keras}/engine/keras_tensor.py (95%) rename {keras => tf_keras}/engine/keras_tensor_test.py (98%) rename {keras => tf_keras}/engine/node.py (96%) rename {keras => tf_keras}/engine/node_test.py (97%) rename {keras => tf_keras}/engine/partial_batch_padding_handler.py (99%) rename {keras => tf_keras}/engine/ragged_keras_tensor_test.py (98%) rename {keras => tf_keras}/engine/saving.py (94%) rename {keras => tf_keras}/engine/sequential.py (96%) rename {keras => tf_keras}/engine/sequential_test.py (99%) rename {keras => tf_keras}/engine/training.py (98%) rename {keras => tf_keras}/engine/training_arrays_test.py (97%) rename {keras => tf_keras}/engine/training_arrays_v1.py (98%) rename {keras => tf_keras}/engine/training_dataset_test.py (98%) rename {keras => tf_keras}/engine/training_distributed_v1.py (97%) rename {keras => tf_keras}/engine/training_eager_test.py (98%) rename {keras => tf_keras}/engine/training_eager_v1.py (98%) rename {keras => tf_keras}/engine/training_generator_test.py (97%) rename {keras => tf_keras}/engine/training_generator_v1.py (98%) rename {keras => tf_keras}/engine/training_gpu_test.py (96%) rename {keras => tf_keras}/engine/training_integration_test.py (98%) rename {keras => tf_keras}/engine/training_test.py (99%) rename {keras => tf_keras}/engine/training_utils.py (99%) rename {keras => tf_keras}/engine/training_utils_v1.py (99%) rename {keras => tf_keras}/engine/training_utils_v1_test.py (98%) rename {keras => tf_keras}/engine/training_v1.py (98%) rename {keras => tf_keras}/estimator/BUILD (65%) rename {keras => tf_keras}/estimator/__init__.py (90%) rename {keras => tf_keras}/export/BUILD (60%) rename {keras => tf_keras}/export/__init__.py (92%) rename {keras => tf_keras}/export/export_lib.py (96%) rename {keras => tf_keras}/export/export_lib_test.py (93%) rename {keras => tf_keras}/feature_column/BUILD (73%) rename {keras => tf_keras}/feature_column/__init__.py (100%) rename {keras => tf_keras}/feature_column/base_feature_layer.py (98%) rename {keras => tf_keras}/feature_column/dense_features.py (97%) rename {keras => tf_keras}/feature_column/dense_features_test.py (99%) rename {keras => tf_keras}/feature_column/dense_features_v2.py (97%) rename {keras => tf_keras}/feature_column/dense_features_v2_test.py (99%) rename {keras => tf_keras}/feature_column/sequence_feature_column.py (98%) rename {keras => tf_keras}/feature_column/sequence_feature_column_integration_test.py (96%) rename {keras => tf_keras}/feature_column/sequence_feature_column_test.py (99%) rename {keras => tf_keras}/initializers/BUILD (51%) rename {keras => tf_keras}/initializers/__init__.py (95%) rename {keras => tf_keras}/initializers/initializers.py (98%) rename {keras => tf_keras}/initializers/initializers_test.py (97%) rename {keras => tf_keras}/initializers/initializers_v1.py (100%) rename {keras => tf_keras}/integration_test/BUILD (76%) rename {keras => tf_keras}/integration_test/README.md (60%) rename {keras => tf_keras}/integration_test/central_storage_strategy_test.py (98%) rename {keras => tf_keras}/integration_test/ctl_tutorial_test.py (99%) rename {keras => tf_keras}/integration_test/custom_object_saving_test.py (96%) rename {keras => tf_keras}/integration_test/data/sentencepiece.pb (100%) rename {keras => tf_keras}/integration_test/distributed_training_test.py (96%) rename {keras => tf_keras}/integration_test/extension_type_test.py (90%) rename {keras => tf_keras}/integration_test/fit_test.py (74%) rename {keras => tf_keras}/integration_test/forwardprop_test.py (100%) rename {keras => tf_keras}/integration_test/function_test.py (100%) rename {keras => tf_keras}/integration_test/gradient_checkpoint_test.py (100%) rename {keras => tf_keras}/integration_test/gradients_test.py (98%) rename {keras => tf_keras}/integration_test/legacy_rnn_test.py (99%) rename {keras => tf_keras}/integration_test/models/BUILD (78%) rename {keras => tf_keras}/integration_test/models/__init__.py (100%) rename {keras => tf_keras}/integration_test/models/bert.py (97%) rename {keras => tf_keras}/integration_test/models/ctc_speech_rnn.py (96%) rename {keras => tf_keras}/integration_test/models/dcgan.py (97%) rename {keras => tf_keras}/integration_test/models/edge_case_model.py (97%) rename {keras => tf_keras}/integration_test/models/efficientnet_v2.py (98%) rename {keras => tf_keras}/integration_test/models/input_spec.py (100%) rename {keras => tf_keras}/integration_test/models/low_level_model.py (97%) rename {keras => tf_keras}/integration_test/models/mini_unet.py (95%) rename {keras => tf_keras}/integration_test/models/mini_xception.py (95%) rename {keras => tf_keras}/integration_test/models/retinanet.py (98%) rename {keras => tf_keras}/integration_test/models/structured_data_classification.py (96%) rename {keras => tf_keras}/integration_test/models/text_classification.py (96%) rename {keras => tf_keras}/integration_test/models/timeseries_forecasting.py (87%) rename {keras => tf_keras}/integration_test/models/translation.py (98%) rename {keras => tf_keras}/integration_test/models/vae.py (96%) rename {keras => tf_keras}/integration_test/module_test.py (100%) rename {keras => tf_keras}/integration_test/multi_worker_tutorial_test.py (100%) rename {keras => tf_keras}/integration_test/mwms_multi_process_runner_test.py (94%) rename {keras => tf_keras}/integration_test/parameter_server_custom_training_loop_test.py (100%) rename {keras => tf_keras}/integration_test/parameter_server_keras_preprocessing_test.py (99%) rename {keras => tf_keras}/integration_test/parameter_server_training_metric_test.py (94%) rename {keras => tf_keras}/integration_test/preprocessing_applied_in_dataset_creator_test.py (93%) rename {keras => tf_keras}/integration_test/preprocessing_applied_in_dataset_test.py (91%) rename {keras => tf_keras}/integration_test/preprocessing_applied_in_model_test.py (94%) rename {keras => tf_keras}/integration_test/preprocessing_test_utils.py (98%) rename {keras => tf_keras}/integration_test/py_metric_test.py (91%) rename {keras => tf_keras}/integration_test/saved_model_test.py (100%) rename {keras => tf_keras}/integration_test/saving_v3_test.py (83%) rename {keras => tf_keras}/integration_test/tf_trt_test.py (96%) rename {keras => tf_keras}/integration_test/tpu_strategy_test.py (100%) rename {keras => tf_keras}/integration_test/vectorized_map_test.py (100%) rename {keras => tf_keras}/kokoro/github/ubuntu/cpu/build.sh (100%) rename {keras => tf_keras}/kokoro/github/ubuntu/cpu/continuous.cfg (100%) rename {keras => tf_keras}/kokoro/github/ubuntu/cpu/presubmit.cfg (100%) rename {keras => tf_keras}/kokoro/github/ubuntu/gpu/build.sh (100%) rename {keras => tf_keras}/kokoro/github/ubuntu/gpu/continuous.cfg (100%) rename {keras => tf_keras}/kokoro/github/ubuntu/gpu/presubmit.cfg (100%) rename {keras => tf_keras}/layers/BUILD (55%) create mode 100644 tf_keras/layers/__init__.py rename {keras => tf_keras}/layers/activation/BUILD (56%) rename {keras => tf_keras}/layers/activation/__init__.py (68%) rename {keras => tf_keras}/layers/activation/elu.py (94%) rename {keras => tf_keras}/layers/activation/elu_test.py (92%) rename {keras => tf_keras}/layers/activation/leaky_relu.py (95%) rename {keras => tf_keras}/layers/activation/leaky_relu_test.py (93%) rename {keras => tf_keras}/layers/activation/prelu.py (94%) rename {keras => tf_keras}/layers/activation/prelu_test.py (91%) rename {keras => tf_keras}/layers/activation/relu.py (97%) rename {keras => tf_keras}/layers/activation/relu_test.py (97%) rename {keras => tf_keras}/layers/activation/softmax.py (97%) rename {keras => tf_keras}/layers/activation/softmax_test.py (89%) rename {keras => tf_keras}/layers/activation/thresholded_relu.py (95%) rename {keras => tf_keras}/layers/activation/thresholded_relu_test.py (94%) rename {keras => tf_keras}/layers/attention/BUILD (65%) rename {keras => tf_keras}/layers/attention/__init__.py (77%) rename {keras => tf_keras}/layers/attention/additive_attention.py (98%) rename {keras => tf_keras}/layers/attention/additive_attention_test.py (98%) rename {keras => tf_keras}/layers/attention/attention.py (99%) rename {keras => tf_keras}/layers/attention/attention_test.py (99%) rename {keras => tf_keras}/layers/attention/base_dense_attention.py (98%) rename {keras => tf_keras}/layers/attention/base_dense_attention_test.py (97%) rename {keras => tf_keras}/layers/attention/multi_head_attention.py (98%) rename {keras => tf_keras}/layers/attention/multi_head_attention_test.py (99%) create mode 100644 tf_keras/layers/convolutional/BUILD create mode 100644 tf_keras/layers/convolutional/__init__.py rename {keras => tf_keras}/layers/convolutional/base_conv.py (97%) rename {keras => tf_keras}/layers/convolutional/base_depthwise_conv.py (97%) rename {keras => tf_keras}/layers/convolutional/base_separable_conv.py (97%) rename {keras => tf_keras}/layers/convolutional/conv1d.py (97%) rename {keras => tf_keras}/layers/convolutional/conv1d_transpose.py (97%) rename {keras => tf_keras}/layers/convolutional/conv2d.py (96%) rename {keras => tf_keras}/layers/convolutional/conv2d_transpose.py (97%) rename {keras => tf_keras}/layers/convolutional/conv3d.py (96%) rename {keras => tf_keras}/layers/convolutional/conv3d_transpose.py (97%) rename {keras => tf_keras}/layers/convolutional/conv_test.py (99%) rename {keras => tf_keras}/layers/convolutional/conv_transpose_test.py (98%) rename {keras => tf_keras}/layers/convolutional/depthwise_conv1d.py (97%) rename {keras => tf_keras}/layers/convolutional/depthwise_conv2d.py (97%) rename {keras => tf_keras}/layers/convolutional/depthwise_conv_test.py (97%) rename {keras => tf_keras}/layers/convolutional/separable_conv1d.py (97%) rename {keras => tf_keras}/layers/convolutional/separable_conv2d.py (97%) rename {keras => tf_keras}/layers/convolutional/separable_conv_test.py (98%) rename {keras => tf_keras}/layers/core/BUILD (56%) create mode 100644 tf_keras/layers/core/__init__.py rename {keras => tf_keras}/layers/core/activation.py (96%) rename {keras => tf_keras}/layers/core/core_test.py (98%) rename {keras => tf_keras}/layers/core/dense.py (97%) rename {keras => tf_keras}/layers/core/einsum_dense.py (98%) rename {keras => tf_keras}/layers/core/einsum_dense_test.py (97%) rename {keras => tf_keras}/layers/core/embedding.py (93%) rename {keras => tf_keras}/layers/core/embedding_test.py (93%) rename {keras => tf_keras}/layers/core/identity.py (96%) rename {keras => tf_keras}/layers/core/lambda_layer.py (98%) rename {keras => tf_keras}/layers/core/masking.py (96%) rename {keras => tf_keras}/layers/core/tf_op_layer.py (97%) rename {keras => tf_keras}/layers/kernelized.py (98%) rename {keras => tf_keras}/layers/kernelized_test.py (97%) rename {keras => tf_keras}/layers/layers_test.py (97%) rename {keras => tf_keras}/layers/locally_connected/BUILD (50%) rename {keras => tf_keras}/layers/locally_connected/__init__.py (85%) rename {keras => tf_keras}/layers/locally_connected/locally_connected1d.py (96%) rename {keras => tf_keras}/layers/locally_connected/locally_connected2d.py (97%) rename {keras => tf_keras}/layers/locally_connected/locally_connected_test.py (99%) rename {keras => tf_keras}/layers/locally_connected/locally_connected_utils.py (99%) rename {keras => tf_keras}/layers/merging/BUILD (78%) create mode 100644 tf_keras/layers/merging/__init__.py rename {keras => tf_keras}/layers/merging/add.py (98%) rename {keras => tf_keras}/layers/merging/average.py (98%) rename {keras => tf_keras}/layers/merging/base_merge.py (98%) rename {keras => tf_keras}/layers/merging/concatenate.py (98%) rename {keras => tf_keras}/layers/merging/dot.py (98%) rename {keras => tf_keras}/layers/merging/maximum.py (98%) rename {keras => tf_keras}/layers/merging/merging_test.py (99%) rename {keras => tf_keras}/layers/merging/minimum.py (97%) rename {keras => tf_keras}/layers/merging/multiply.py (98%) rename {keras => tf_keras}/layers/merging/subtract.py (94%) rename {keras => tf_keras}/layers/noise.py (78%) rename {keras => tf_keras}/layers/normalization/BUILD (63%) rename {keras => tf_keras}/layers/normalization/__init__.py (100%) rename {keras => tf_keras}/layers/normalization/batch_normalization.py (99%) rename {keras => tf_keras}/layers/normalization/batch_normalization_dtensor_test.py (96%) rename {keras => tf_keras}/layers/normalization/batch_normalization_test.py (98%) rename {keras => tf_keras}/layers/normalization/batch_normalization_v1.py (94%) rename {keras => tf_keras}/layers/normalization/group_normalization.py (97%) rename {keras => tf_keras}/layers/normalization/group_normalization_test.py (97%) rename {keras => tf_keras}/layers/normalization/layer_normalization.py (98%) rename {keras => tf_keras}/layers/normalization/layer_normalization_test.py (98%) rename {keras => tf_keras}/layers/normalization/spectral_normalization.py (96%) rename {keras => tf_keras}/layers/normalization/spectral_normalization_test.py (97%) rename {keras => tf_keras}/layers/normalization/unit_normalization.py (97%) rename {keras => tf_keras}/layers/normalization/unit_normalization_test.py (95%) rename {keras => tf_keras}/layers/pooling/BUILD (72%) create mode 100644 tf_keras/layers/pooling/__init__.py rename {keras => tf_keras}/layers/pooling/average_pooling1d.py (98%) rename {keras => tf_keras}/layers/pooling/average_pooling2d.py (97%) rename {keras => tf_keras}/layers/pooling/average_pooling3d.py (96%) rename {keras => tf_keras}/layers/pooling/average_pooling_test.py (96%) rename {keras => tf_keras}/layers/pooling/base_global_pooling1d.py (95%) rename {keras => tf_keras}/layers/pooling/base_global_pooling2d.py (95%) rename {keras => tf_keras}/layers/pooling/base_global_pooling3d.py (95%) rename {keras => tf_keras}/layers/pooling/base_pooling1d.py (96%) rename {keras => tf_keras}/layers/pooling/base_pooling2d.py (96%) rename {keras => tf_keras}/layers/pooling/base_pooling3d.py (96%) rename {keras => tf_keras}/layers/pooling/global_average_pooling1d.py (97%) rename {keras => tf_keras}/layers/pooling/global_average_pooling2d.py (94%) rename {keras => tf_keras}/layers/pooling/global_average_pooling3d.py (94%) rename {keras => tf_keras}/layers/pooling/global_average_pooling_test.py (97%) rename {keras => tf_keras}/layers/pooling/global_max_pooling1d.py (96%) rename {keras => tf_keras}/layers/pooling/global_max_pooling2d.py (94%) rename {keras => tf_keras}/layers/pooling/global_max_pooling3d.py (94%) rename {keras => tf_keras}/layers/pooling/global_max_pooling_test.py (97%) rename {keras => tf_keras}/layers/pooling/max_pooling1d.py (97%) rename {keras => tf_keras}/layers/pooling/max_pooling2d.py (97%) rename {keras => tf_keras}/layers/pooling/max_pooling3d.py (96%) rename {keras => tf_keras}/layers/pooling/max_pooling_test.py (95%) rename {keras => tf_keras}/layers/preprocessing/BUILD (71%) rename {keras => tf_keras}/layers/preprocessing/__init__.py (100%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/BUILD (78%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/__init__.py (100%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/bucketized_column_dense_benchmark.py (94%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/category_encoding_benchmark.py (94%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/category_hash_dense_benchmark.py (94%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/category_hash_varlen_benchmark.py (94%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/category_vocab_file_dense_benchmark.py (95%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/category_vocab_file_varlen_benchmark.py (95%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/category_vocab_list_dense_benchmark.py (94%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/category_vocab_list_indicator_dense_benchmark.py (92%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/category_vocab_list_indicator_varlen_benchmark.py (92%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/category_vocab_list_varlen_benchmark.py (94%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/discretization_adapt_benchmark.py (95%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/embedding_dense_benchmark.py (96%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/embedding_varlen_benchmark.py (96%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/feature_column_benchmark.py (97%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/hashed_crossing_benchmark.py (94%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/hashing_benchmark.py (96%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/image_preproc_benchmark.py (97%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py (96%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/index_lookup_forward_benchmark.py (96%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py (96%) rename {keras => tf_keras}/layers/preprocessing/benchmarks/weighted_embedding_varlen_benchmark.py (96%) rename {keras => tf_keras}/layers/preprocessing/category_encoding.py (96%) rename {keras => tf_keras}/layers/preprocessing/category_encoding_distribution_test.py (90%) rename {keras => tf_keras}/layers/preprocessing/category_encoding_test.py (98%) rename {keras => tf_keras}/layers/preprocessing/discretization.py (98%) rename {keras => tf_keras}/layers/preprocessing/discretization_distribution_test.py (88%) rename {keras => tf_keras}/layers/preprocessing/discretization_test.py (97%) rename {keras => tf_keras}/layers/preprocessing/hashed_crossing.py (96%) rename {keras => tf_keras}/layers/preprocessing/hashed_crossing_test.py (97%) rename {keras => tf_keras}/layers/preprocessing/hashing.py (97%) rename {keras => tf_keras}/layers/preprocessing/hashing_distribution_test.py (88%) rename {keras => tf_keras}/layers/preprocessing/hashing_test.py (98%) rename {keras => tf_keras}/layers/preprocessing/image_preprocessing.py (98%) rename {keras => tf_keras}/layers/preprocessing/image_preprocessing_distribution_test.py (90%) rename {keras => tf_keras}/layers/preprocessing/image_preprocessing_test.py (99%) rename {keras => tf_keras}/layers/preprocessing/index_lookup.py (99%) rename {keras => tf_keras}/layers/preprocessing/index_lookup_distribution_test.py (95%) rename {keras => tf_keras}/layers/preprocessing/index_lookup_test.py (99%) rename {keras => tf_keras}/layers/preprocessing/integer_lookup.py (99%) rename {keras => tf_keras}/layers/preprocessing/integer_lookup_test.py (98%) rename {keras => tf_keras}/layers/preprocessing/normalization.py (98%) rename {keras => tf_keras}/layers/preprocessing/normalization_distribution_test.py (93%) rename {keras => tf_keras}/layers/preprocessing/normalization_test.py (98%) rename {keras => tf_keras}/layers/preprocessing/preprocessing_stage.py (98%) rename {keras => tf_keras}/layers/preprocessing/preprocessing_stage_functional_test.py (96%) rename {keras => tf_keras}/layers/preprocessing/preprocessing_stage_test.py (92%) rename {keras => tf_keras}/layers/preprocessing/preprocessing_test_utils.py (100%) rename {keras => tf_keras}/layers/preprocessing/preprocessing_utils.py (99%) rename {keras => tf_keras}/layers/preprocessing/preprocessing_utils_test.py (97%) rename {keras => tf_keras}/layers/preprocessing/string_lookup.py (99%) rename {keras => tf_keras}/layers/preprocessing/string_lookup_test.py (98%) rename {keras => tf_keras}/layers/preprocessing/text_vectorization.py (98%) rename {keras => tf_keras}/layers/preprocessing/text_vectorization_distribution_test.py (93%) rename {keras => tf_keras}/layers/preprocessing/text_vectorization_test.py (99%) rename {keras => tf_keras}/layers/regularization/BUILD (70%) rename {keras => tf_keras}/layers/regularization/__init__.py (56%) rename {keras => tf_keras}/layers/regularization/activity_regularization.py (95%) rename {keras => tf_keras}/layers/regularization/activity_regularization_test.py (94%) rename {keras => tf_keras}/layers/regularization/alpha_dropout.py (97%) rename {keras => tf_keras}/layers/regularization/alpha_dropout_test.py (93%) rename {keras => tf_keras}/layers/regularization/dropout.py (97%) rename {keras => tf_keras}/layers/regularization/dropout_test.py (98%) rename {keras => tf_keras}/layers/regularization/gaussian_dropout.py (96%) rename {keras => tf_keras}/layers/regularization/gaussian_dropout_test.py (93%) rename {keras => tf_keras}/layers/regularization/gaussian_noise.py (96%) rename {keras => tf_keras}/layers/regularization/gaussian_noise_test.py (93%) rename {keras => tf_keras}/layers/regularization/spatial_dropout1d.py (95%) rename {keras => tf_keras}/layers/regularization/spatial_dropout2d.py (93%) rename {keras => tf_keras}/layers/regularization/spatial_dropout3d.py (94%) rename {keras => tf_keras}/layers/regularization/spatial_dropout_test.py (93%) rename {keras => tf_keras}/layers/reshaping/BUILD (63%) create mode 100644 tf_keras/layers/reshaping/__init__.py rename {keras => tf_keras}/layers/reshaping/cropping1d.py (95%) rename {keras => tf_keras}/layers/reshaping/cropping2d.py (97%) rename {keras => tf_keras}/layers/reshaping/cropping3d.py (98%) rename {keras => tf_keras}/layers/reshaping/cropping_test.py (98%) rename {keras => tf_keras}/layers/reshaping/flatten.py (95%) rename {keras => tf_keras}/layers/reshaping/flatten_test.py (94%) rename {keras => tf_keras}/layers/reshaping/permute.py (96%) rename {keras => tf_keras}/layers/reshaping/permute_test.py (91%) rename {keras => tf_keras}/layers/reshaping/repeat_vector.py (94%) rename {keras => tf_keras}/layers/reshaping/repeat_vector_test.py (91%) rename {keras => tf_keras}/layers/reshaping/reshape.py (99%) rename {keras => tf_keras}/layers/reshaping/reshape_test.py (93%) rename {keras => tf_keras}/layers/reshaping/up_sampling1d.py (95%) rename {keras => tf_keras}/layers/reshaping/up_sampling2d.py (94%) rename {keras => tf_keras}/layers/reshaping/up_sampling3d.py (95%) rename {keras => tf_keras}/layers/reshaping/up_sampling_test.py (98%) rename {keras => tf_keras}/layers/reshaping/zero_padding1d.py (94%) rename {keras => tf_keras}/layers/reshaping/zero_padding2d.py (96%) rename {keras => tf_keras}/layers/reshaping/zero_padding3d.py (96%) rename {keras => tf_keras}/layers/reshaping/zero_padding_test.py (99%) rename {keras => tf_keras}/layers/rnn/BUILD (60%) create mode 100644 tf_keras/layers/rnn/__init__.py rename {keras => tf_keras}/layers/rnn/abstract_rnn_cell.py (96%) rename {keras => tf_keras}/layers/rnn/base_conv_lstm.py (97%) rename {keras => tf_keras}/layers/rnn/base_conv_rnn.py (98%) rename {keras => tf_keras}/layers/rnn/base_cudnn_rnn.py (97%) rename {keras => tf_keras}/layers/rnn/base_rnn.py (97%) rename {keras => tf_keras}/layers/rnn/base_rnn_test.py (99%) rename {keras => tf_keras}/layers/rnn/base_wrapper.py (90%) rename {keras => tf_keras}/layers/rnn/base_wrapper_test.py (98%) rename {keras => tf_keras}/layers/rnn/bidirectional.py (97%) rename {keras => tf_keras}/layers/rnn/bidirectional_test.py (99%) rename {keras => tf_keras}/layers/rnn/cell_wrappers.py (98%) rename {keras => tf_keras}/layers/rnn/cell_wrappers_test.py (97%) rename {keras => tf_keras}/layers/rnn/conv_lstm1d.py (98%) rename {keras => tf_keras}/layers/rnn/conv_lstm2d.py (98%) rename {keras => tf_keras}/layers/rnn/conv_lstm3d.py (98%) rename {keras => tf_keras}/layers/rnn/conv_lstm_test.py (99%) rename {keras => tf_keras}/layers/rnn/cudnn_gru.py (97%) rename {keras => tf_keras}/layers/rnn/cudnn_lstm.py (97%) rename {keras => tf_keras}/layers/rnn/cudnn_test.py (99%) rename {keras => tf_keras}/layers/rnn/dropout_rnn_cell_mixin.py (99%) rename {keras => tf_keras}/layers/rnn/gru.py (98%) rename {keras => tf_keras}/layers/rnn/gru_lstm_test.py (97%) rename {keras => tf_keras}/layers/rnn/gru_lstm_utils.py (97%) rename {keras => tf_keras}/layers/rnn/gru_test.py (99%) rename {keras => tf_keras}/layers/rnn/gru_v1.py (98%) rename {keras => tf_keras}/layers/rnn/gru_v1_test.py (96%) rename {keras => tf_keras}/layers/rnn/legacy_cell_wrappers.py (98%) rename {keras => tf_keras}/layers/rnn/legacy_cell_wrappers_test.py (90%) rename {keras => tf_keras}/layers/rnn/legacy_cells.py (98%) rename {keras => tf_keras}/layers/rnn/lstm.py (98%) rename {keras => tf_keras}/layers/rnn/lstm_test.py (99%) rename {keras => tf_keras}/layers/rnn/lstm_v1.py (98%) rename {keras => tf_keras}/layers/rnn/lstm_v1_test.py (98%) rename {keras => tf_keras}/layers/rnn/rnn_utils.py (99%) rename {keras => tf_keras}/layers/rnn/simple_rnn.py (96%) rename {keras => tf_keras}/layers/rnn/simple_rnn_test.py (98%) rename {keras => tf_keras}/layers/rnn/stacked_rnn_cells.py (96%) rename {keras => tf_keras}/layers/rnn/time_distributed.py (98%) rename {keras => tf_keras}/layers/rnn/time_distributed_test.py (99%) rename {keras => tf_keras}/layers/serialization.py (79%) rename {keras => tf_keras}/layers/serialization_test.py (94%) rename {keras => tf_keras}/layers/subclassed_layers_test.py (91%) rename {keras => tf_keras}/layers/tensorflow_op_layer_test.py (97%) rename {keras => tf_keras}/legacy_tf_layers/BUILD (79%) create mode 100644 tf_keras/legacy_tf_layers/__init__.py rename {keras => tf_keras}/legacy_tf_layers/base.py (97%) rename {keras => tf_keras}/legacy_tf_layers/base_test.py (98%) rename {keras => tf_keras}/legacy_tf_layers/convolutional.py (98%) rename {keras => tf_keras}/legacy_tf_layers/convolutional_test.py (99%) rename {keras => tf_keras}/legacy_tf_layers/core.py (96%) rename {keras => tf_keras}/legacy_tf_layers/core_test.py (99%) rename {keras => tf_keras}/legacy_tf_layers/migration_utils.py (100%) rename {keras => tf_keras}/legacy_tf_layers/migration_utils_test.py (99%) rename {keras => tf_keras}/legacy_tf_layers/normalization.py (98%) rename {keras => tf_keras}/legacy_tf_layers/normalization_test.py (99%) rename {keras => tf_keras}/legacy_tf_layers/pooling.py (95%) rename {keras => tf_keras}/legacy_tf_layers/pooling_test.py (99%) rename {keras => tf_keras}/legacy_tf_layers/variable_scope_shim.py (96%) rename {keras => tf_keras}/legacy_tf_layers/variable_scope_shim_test.py (99%) rename {keras => tf_keras}/losses.py (99%) rename {keras => tf_keras}/losses_test.py (99%) rename {keras => tf_keras}/metrics/BUILD (65%) create mode 100644 tf_keras/metrics/__init__.py rename {keras => tf_keras}/metrics/accuracy_metrics.py (99%) rename {keras => tf_keras}/metrics/accuracy_metrics_test.py (99%) rename {keras => tf_keras}/metrics/base_metric.py (98%) rename {keras => tf_keras}/metrics/base_metric_test.py (98%) rename {keras => tf_keras}/metrics/confusion_metrics.py (99%) rename {keras => tf_keras}/metrics/confusion_metrics_test.py (99%) rename {keras => tf_keras}/metrics/f_score_metrics.py (99%) rename {keras => tf_keras}/metrics/f_score_metrics_test.py (99%) rename {keras => tf_keras}/metrics/hinge_metrics.py (94%) rename {keras => tf_keras}/metrics/hinge_metrics_test.py (98%) rename {keras => tf_keras}/metrics/iou_metrics.py (99%) rename {keras => tf_keras}/metrics/iou_metrics_test.py (99%) rename {keras => tf_keras}/metrics/metrics_correctness_test.py (99%) rename {keras => tf_keras}/metrics/metrics_functional_test.py (98%) rename {keras => tf_keras}/metrics/probabilistic_metrics.py (97%) rename {keras => tf_keras}/metrics/probabilistic_metrics_test.py (99%) rename {keras => tf_keras}/metrics/py_metric.py (98%) rename {keras => tf_keras}/metrics/py_metric_test.py (96%) rename {keras => tf_keras}/metrics/regression_metrics.py (97%) rename {keras => tf_keras}/metrics/regression_metrics_test.py (99%) rename {keras => tf_keras}/mixed_precision/BUILD (71%) rename {keras => tf_keras}/mixed_precision/__init__.py (70%) rename {keras => tf_keras}/mixed_precision/autocast_variable.py (95%) rename {keras => tf_keras}/mixed_precision/autocast_variable_test.py (92%) rename {keras => tf_keras}/mixed_precision/device_compatibility_check.py (100%) rename {keras => tf_keras}/mixed_precision/device_compatibility_check_test.py (98%) rename {keras => tf_keras}/mixed_precision/layer_correctness_test.py (91%) rename {keras => tf_keras}/mixed_precision/layer_test.py (97%) rename {keras => tf_keras}/mixed_precision/loss_scale_optimizer.py (98%) rename {keras => tf_keras}/mixed_precision/loss_scale_optimizer_test.py (98%) rename {keras => tf_keras}/mixed_precision/mixed_precision_graph_rewrite_test.py (94%) rename {keras => tf_keras}/mixed_precision/model_test.py (96%) rename {keras => tf_keras}/mixed_precision/policy.py (98%) rename {keras => tf_keras}/mixed_precision/policy_test.py (97%) rename {keras => tf_keras}/mixed_precision/test_util.py (97%) rename {keras => tf_keras}/mixed_precision/testdata/BUILD (89%) rename {keras => tf_keras}/mixed_precision/testdata/lso_ckpt_tf2.2/checkpoint (100%) rename {keras => tf_keras}/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.data-00000-of-00002 (100%) rename {keras => tf_keras}/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.data-00001-of-00002 (100%) rename {keras => tf_keras}/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.index (100%) rename {keras => tf_keras}/mixed_precision/testdata/lso_savedmodel_tf2.2/saved_model.pb (100%) rename {keras => tf_keras}/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.data-00000-of-00002 (100%) rename {keras => tf_keras}/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.data-00001-of-00002 (100%) rename {keras => tf_keras}/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.index (100%) rename {keras => tf_keras}/models/BUILD (60%) create mode 100644 tf_keras/models/__init__.py rename {keras => tf_keras}/models/cloning.py (96%) rename {keras => tf_keras}/models/cloning_test.py (98%) rename {keras => tf_keras}/models/sharpness_aware_minimization.py (96%) rename {keras => tf_keras}/models/sharpness_aware_minimization_test.py (96%) create mode 100644 tf_keras/opensource_only.files rename {keras => tf_keras}/optimizers/BUILD (70%) rename {keras => tf_keras}/optimizers/__init__.py (82%) rename {keras => tf_keras}/optimizers/adadelta.py (96%) rename {keras => tf_keras}/optimizers/adafactor.py (97%) rename {keras => tf_keras}/optimizers/adagrad.py (97%) rename {keras => tf_keras}/optimizers/adam.py (98%) rename {keras => tf_keras}/optimizers/adamax.py (98%) rename {keras => tf_keras}/optimizers/adamw.py (98%) rename {keras => tf_keras}/optimizers/ftrl.py (98%) rename {keras => tf_keras}/optimizers/legacy/BUILD (72%) rename {keras => tf_keras}/optimizers/legacy/__init__.py (100%) rename {keras => tf_keras}/optimizers/legacy/adadelta.py (96%) rename {keras => tf_keras}/optimizers/legacy/adadelta_test.py (98%) rename {keras => tf_keras}/optimizers/legacy/adagrad.py (97%) rename {keras => tf_keras}/optimizers/legacy/adagrad_test.py (99%) rename {keras => tf_keras}/optimizers/legacy/adam.py (98%) rename {keras => tf_keras}/optimizers/legacy/adam_test.py (99%) rename {keras => tf_keras}/optimizers/legacy/adamax.py (98%) rename {keras => tf_keras}/optimizers/legacy/adamax_test.py (99%) rename {keras => tf_keras}/optimizers/legacy/ftrl.py (99%) rename {keras => tf_keras}/optimizers/legacy/ftrl_test.py (99%) rename {keras => tf_keras}/optimizers/legacy/gradient_descent.py (99%) rename {keras => tf_keras}/optimizers/legacy/gradient_descent_test.py (99%) rename {keras => tf_keras}/optimizers/legacy/nadam.py (98%) rename {keras => tf_keras}/optimizers/legacy/nadam_test.py (99%) rename {keras => tf_keras}/optimizers/legacy/optimizer_v2.py (98%) rename {keras => tf_keras}/optimizers/legacy/optimizer_v2_test.py (98%) rename {keras => tf_keras}/optimizers/legacy/rmsprop.py (98%) rename {keras => tf_keras}/optimizers/legacy/rmsprop_test.py (99%) rename {keras => tf_keras}/optimizers/legacy_learning_rate_decay.py (99%) rename {keras => tf_keras}/optimizers/legacy_learning_rate_decay_test.py (99%) rename {keras => tf_keras}/optimizers/lion.py (98%) rename {keras => tf_keras}/optimizers/lion_test.py (99%) rename {keras => tf_keras}/optimizers/nadam.py (98%) rename {keras => tf_keras}/optimizers/optimizer.py (98%) rename {keras => tf_keras}/optimizers/optimizer_pss_test.py (91%) rename {keras => tf_keras}/optimizers/optimizer_test.py (96%) rename {keras => tf_keras}/optimizers/optimizer_v1.py (99%) rename {keras => tf_keras}/optimizers/optimizer_v1_test.py (97%) rename {keras => tf_keras}/optimizers/rmsprop.py (98%) create mode 100644 tf_keras/optimizers/schedules/BUILD rename {keras => tf_keras}/optimizers/schedules/__init__.py (70%) rename {keras => tf_keras}/optimizers/schedules/learning_rate_schedule.py (99%) rename {keras => tf_keras}/optimizers/schedules/learning_rate_schedule_test.py (99%) rename {keras => tf_keras}/optimizers/sgd.py (98%) rename {keras => tf_keras}/optimizers/utils.py (100%) rename {keras => tf_keras}/premade_models/BUILD (66%) rename {keras => tf_keras}/premade_models/__init__.py (88%) rename {keras => tf_keras}/premade_models/linear.py (96%) rename {keras => tf_keras}/premade_models/linear_test.py (94%) rename {keras => tf_keras}/premade_models/wide_deep.py (97%) rename {keras => tf_keras}/premade_models/wide_deep_test.py (96%) rename {keras => tf_keras}/preprocessing/BUILD (74%) rename {keras => tf_keras}/preprocessing/__init__.py (87%) rename {keras => tf_keras}/preprocessing/image.py (99%) rename {keras => tf_keras}/preprocessing/image_test.py (99%) rename {keras => tf_keras}/preprocessing/sequence.py (98%) rename {keras => tf_keras}/preprocessing/sequence_test.py (99%) rename {keras => tf_keras}/preprocessing/text.py (98%) rename {keras => tf_keras}/preprocessing/text_test.py (99%) rename {keras => tf_keras}/protobuf/BUILD (77%) rename {keras => tf_keras}/protobuf/projector_config.proto (97%) rename {keras => tf_keras}/protobuf/saved_metadata.proto (77%) rename {keras => tf_keras}/protobuf/versions.proto (93%) rename {keras => tf_keras}/regularizers.py (96%) rename {keras => tf_keras}/regularizers_test.py (98%) rename {keras => tf_keras}/saving/BUILD (65%) rename {keras => tf_keras}/saving/__init__.py (100%) rename {keras => tf_keras}/saving/legacy/__init__.py (100%) rename {keras => tf_keras}/saving/legacy/hdf5_format.py (96%) rename {keras => tf_keras}/saving/legacy/losses_serialization_test.py (95%) rename {keras => tf_keras}/saving/legacy/metrics_serialization_test.py (96%) rename {keras => tf_keras}/saving/legacy/model_config.py (92%) rename {keras => tf_keras}/saving/legacy/save.py (95%) rename {keras => tf_keras}/saving/legacy/save_test.py (98%) rename {keras => tf_keras}/saving/legacy/save_weights_test.py (99%) rename {keras => tf_keras}/saving/legacy/saved_model/BUILD (76%) rename {keras => tf_keras}/saving/legacy/saved_model/README.md (85%) rename {keras => tf_keras}/saving/legacy/saved_model/__init__.py (100%) rename {keras => tf_keras}/saving/legacy/saved_model/base_serialization.py (97%) rename {keras => tf_keras}/saving/legacy/saved_model/constants.py (91%) rename {keras => tf_keras}/saving/legacy/saved_model/create_test_saved_model.py (92%) rename {keras => tf_keras}/saving/legacy/saved_model/determinism_test.py (100%) rename {keras => tf_keras}/saving/legacy/saved_model/json_utils.py (96%) rename {keras => tf_keras}/saving/legacy/saved_model/json_utils_test.py (95%) rename {keras => tf_keras}/saving/legacy/saved_model/layer_serialization.py (95%) rename {keras => tf_keras}/saving/legacy/saved_model/load.py (95%) rename {keras => tf_keras}/saving/legacy/saved_model/load_context.py (100%) rename {keras => tf_keras}/saving/legacy/saved_model/metric_serialization.py (90%) rename {keras => tf_keras}/saving/legacy/saved_model/model_serialization.py (91%) rename {keras => tf_keras}/saving/legacy/saved_model/network_serialization.py (89%) rename {keras => tf_keras}/saving/legacy/saved_model/order_preserving_set.py (100%) rename {keras => tf_keras}/saving/legacy/saved_model/revive_test.py (97%) rename {keras => tf_keras}/saving/legacy/saved_model/save.py (87%) rename {keras => tf_keras}/saving/legacy/saved_model/save_impl.py (95%) rename {keras => tf_keras}/saving/legacy/saved_model/saved_model_test.py (98%) rename {keras => tf_keras}/saving/legacy/saved_model/serialized_attributes.py (92%) rename {keras => tf_keras}/saving/legacy/saved_model/utils.py (96%) rename {keras => tf_keras}/saving/legacy/saving_utils.py (92%) rename {keras => tf_keras}/saving/legacy/saving_utils_test.py (98%) rename {keras => tf_keras}/saving/legacy/serialization.py (96%) rename {keras => tf_keras}/saving/object_registration.py (91%) rename {keras => tf_keras}/saving/object_registration_test.py (96%) rename {keras => tf_keras}/saving/pickle_utils.py (92%) rename {keras => tf_keras}/saving/pickle_utils_test.py (95%) rename {keras => tf_keras}/saving/saving_api.py (93%) rename {keras => tf_keras}/saving/saving_lib.py (94%) rename {keras => tf_keras}/saving/saving_lib_test.py (98%) rename {keras => tf_keras}/saving/serialization_lib.py (95%) rename {keras => tf_keras}/saving/serialization_lib_test.py (98%) rename {keras => tf_keras}/testing_infra/BUILD (63%) rename {keras => tf_keras}/testing_infra/__init__.py (100%) rename {keras => tf_keras}/testing_infra/keras_doctest_lib.py (99%) rename {keras => tf_keras}/testing_infra/keras_doctest_lib_test.py (99%) rename {keras => tf_keras}/testing_infra/test_combinations.py (94%) rename {keras => tf_keras}/testing_infra/test_combinations_test.py (99%) rename {keras => tf_keras}/testing_infra/test_utils.py (96%) rename {keras => tf_keras}/tests/BUILD (64%) rename {keras => tf_keras}/tests/__init__.py (100%) rename {keras => tf_keras}/tests/add_loss_correctness_test.py (98%) rename {keras => tf_keras}/tests/automatic_outside_compilation_test.py (95%) rename {keras => tf_keras}/tests/convert_to_constants_test.py (96%) rename {keras => tf_keras}/tests/custom_training_loop_test.py (98%) rename {keras => tf_keras}/tests/get_config_samples.py (100%) rename {keras => tf_keras}/tests/get_config_test.py (91%) rename {keras => tf_keras}/tests/graph_util_test.py (97%) rename {keras => tf_keras}/tests/integration_test.py (98%) rename {keras => tf_keras}/tests/keras_doctest.py (98%) rename {keras => tf_keras}/tests/memory_checker_test.py (99%) rename {keras => tf_keras}/tests/memory_test.py (98%) rename {keras => tf_keras}/tests/model_architectures.py (99%) rename {keras => tf_keras}/tests/model_architectures_test.py (94%) rename {keras => tf_keras}/tests/model_subclassing_compiled_test.py (98%) rename {keras => tf_keras}/tests/model_subclassing_test.py (99%) rename {keras => tf_keras}/tests/model_subclassing_test_util.py (98%) rename {keras => tf_keras}/tests/saved_model_test.py (96%) rename {keras => tf_keras}/tests/saver_test.py (98%) rename {keras => tf_keras}/tests/serialization_util_test.py (89%) rename {keras => tf_keras}/tests/temporal_sample_weights_correctness_test.py (98%) rename {keras => tf_keras}/tests/tracking_test.py (99%) rename {keras => tf_keras}/tests/tracking_util_test.py (99%) rename {keras => tf_keras}/tests/tracking_util_with_v1_optimizers_test.py (99%) rename {keras => tf_keras}/tests/tracking_util_xla_test.py (96%) rename keras/keras.bzl => tf_keras/tf_keras.bzl (99%) rename {keras => tf_keras}/tools/bazel_build.sh (100%) rename {keras => tf_keras}/tools/gpu_build/BUILD (100%) rename {keras => tf_keras}/tools/gpu_build/parallel_gpu_execute.sh (100%) create mode 100644 tf_keras/tools/pip_package/BUILD rename {keras => tf_keras}/tools/pip_package/build_pip_package.sh (100%) rename {keras => tf_keras}/tools/pip_package/create_pip_helper.py (85%) rename {keras => tf_keras}/tools/pip_package/setup.py (93%) rename {keras => tf_keras}/utils/BUILD (78%) create mode 100644 tf_keras/utils/__init__.py rename {keras => tf_keras}/utils/audio_dataset.py (99%) rename {keras => tf_keras}/utils/audio_dataset_test.py (99%) rename {keras => tf_keras}/utils/audio_dataset_with_tfio_test.py (97%) rename {keras => tf_keras}/utils/composite_tensor_support_test.py (98%) rename {keras => tf_keras}/utils/control_flow_util.py (100%) rename {keras => tf_keras}/utils/conv_utils.py (99%) rename {keras => tf_keras}/utils/conv_utils_test.py (99%) rename {keras => tf_keras}/utils/data_utils.py (99%) rename {keras => tf_keras}/utils/data_utils_test.py (99%) rename {keras => tf_keras}/utils/dataset_creator.py (100%) rename {keras => tf_keras}/utils/dataset_creator_test.py (94%) rename {keras => tf_keras}/utils/dataset_utils.py (99%) rename {keras => tf_keras}/utils/dataset_utils_test.py (99%) rename {keras => tf_keras}/utils/feature_space.py (97%) rename {keras => tf_keras}/utils/feature_space_test.py (98%) rename {keras => tf_keras}/utils/generic_utils.py (99%) rename {keras => tf_keras}/utils/generic_utils_test.py (98%) rename {keras => tf_keras}/utils/image_dataset.py (99%) rename {keras => tf_keras}/utils/image_dataset_test.py (98%) rename {keras => tf_keras}/utils/image_utils.py (99%) rename {keras => tf_keras}/utils/image_utils_test.py (99%) rename {keras => tf_keras}/utils/io_utils.py (91%) rename {keras => tf_keras}/utils/io_utils_test.py (97%) rename {keras => tf_keras}/utils/keras_logging.py (100%) rename {keras => tf_keras}/utils/kernelized_utils.py (100%) rename {keras => tf_keras}/utils/kernelized_utils_test.py (99%) rename {keras => tf_keras}/utils/kpl_test_utils.py (98%) rename {keras => tf_keras}/utils/layer_utils.py (99%) rename {keras => tf_keras}/utils/layer_utils_test.py (99%) rename {keras => tf_keras}/utils/legacy/__init__.py (79%) rename {keras => tf_keras}/utils/losses_utils.py (99%) rename {keras => tf_keras}/utils/losses_utils_test.py (97%) rename {keras => tf_keras}/utils/metrics_utils.py (99%) rename {keras => tf_keras}/utils/metrics_utils_test.py (99%) rename {keras => tf_keras}/utils/mode_keys.py (100%) rename {keras => tf_keras}/utils/np_utils.py (100%) rename {keras => tf_keras}/utils/np_utils_test.py (97%) rename {keras => tf_keras}/utils/object_identity.py (100%) rename {keras => tf_keras}/utils/sidecar_evaluator.py (97%) rename {keras => tf_keras}/utils/sidecar_evaluator_test.py (97%) rename {keras => tf_keras}/utils/steps_per_execution_tuning.py (99%) rename {keras => tf_keras}/utils/steps_per_execution_tuning_test.py (94%) rename {keras => tf_keras}/utils/text_dataset.py (99%) rename {keras => tf_keras}/utils/text_dataset_test.py (98%) rename {keras => tf_keras}/utils/tf_contextlib.py (100%) rename {keras => tf_keras}/utils/tf_inspect.py (100%) rename {keras => tf_keras}/utils/tf_utils.py (97%) rename {keras => tf_keras}/utils/tf_utils_test.py (98%) rename {keras => tf_keras}/utils/timed_threads.py (100%) rename {keras => tf_keras}/utils/timed_threads_test.py (96%) rename {keras => tf_keras}/utils/timeseries_dataset.py (100%) rename {keras => tf_keras}/utils/timeseries_dataset_test.py (98%) rename {keras => tf_keras}/utils/traceback_utils.py (98%) rename {keras => tf_keras}/utils/traceback_utils_test.py (98%) rename {keras => tf_keras}/utils/version_utils.py (83%) rename {keras => tf_keras}/utils/version_utils_test.py (94%) rename {keras => tf_keras}/utils/vis_utils.py (97%) rename {keras => tf_keras}/utils/vis_utils_test.py (97%) diff --git a/.github/ISSUE_TEMPLATE/00-bug-template.md b/.github/ISSUE_TEMPLATE/00-bug-template.md index 195e5e593..91950ce17 100644 --- a/.github/ISSUE_TEMPLATE/00-bug-template.md +++ b/.github/ISSUE_TEMPLATE/00-bug-template.md @@ -37,17 +37,17 @@ python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VER **Describe the problem**. -Describe the problem clearly here. Be sure to convey here why it's a bug in Keras or why the requested feature is needed. +Describe the problem clearly here. Be sure to convey here why it's a bug in TF-Keras or why the requested feature is needed. **Describe the current behavior**. **Describe the expected behavior**. -**[Contributing](https://github.com/keras-team/keras/blob/master/CONTRIBUTING.md)**. +**[Contributing](https://github.com/keras-team/tf-keras/blob/master/CONTRIBUTING.md)**. - Do you want to contribute a PR? (yes/no): -- If yes, please read [this page](https://github.com/keras-team/keras/blob/master/CONTRIBUTING.md) for instructions +- If yes, please read [this page](https://github.com/keras-team/tf-keras/blob/master/CONTRIBUTING.md) for instructions - Briefly describe your candidate solution(if contributing): **Standalone code to reproduce the issue**. diff --git a/.github/ISSUE_TEMPLATE/10-feature-request.md b/.github/ISSUE_TEMPLATE/10-feature-request.md index 4add0bcc3..082c764d4 100644 --- a/.github/ISSUE_TEMPLATE/10-feature-request.md +++ b/.github/ISSUE_TEMPLATE/10-feature-request.md @@ -30,8 +30,8 @@ Describe the feature clearly here. Be sure to convey here why the requested feat **Who will benefit from this feature?** -**[Contributing](https://github.com/keras-team/keras/blob/master/CONTRIBUTING.md)** +**[Contributing](https://github.com/keras-team/tf-keras/blob/master/CONTRIBUTING.md)** - Do you want to contribute a PR? (yes/no): -- If yes, please read [this page](https://github.com/keras-team/keras/blob/master/CONTRIBUTING.md) for instructions +- If yes, please read [this page](https://github.com/keras-team/tf-keras/blob/master/CONTRIBUTING.md) for instructions - Briefly describe your candidate solution(if contributing): diff --git a/.github/ISSUE_TEMPLATE/20-documentation-issue.md b/.github/ISSUE_TEMPLATE/20-documentation-issue.md index 09cc385ec..c126f42f3 100644 --- a/.github/ISSUE_TEMPLATE/20-documentation-issue.md +++ b/.github/ISSUE_TEMPLATE/20-documentation-issue.md @@ -58,6 +58,6 @@ Are there currently visuals? If not, will it clarify the content? **Submit a pull request?**. -Are you planning to also submit a pull request to fix the issue? See the [docs contributor guide](https://github.com/keras-team/keras/blob/master/CONTRIBUTING.md): +Are you planning to also submit a pull request to fix the issue? See the [docs contributor guide](https://github.com/keras-team/tf-keras/blob/master/CONTRIBUTING.md): diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 68e0256ba..10732c722 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -46,7 +46,7 @@ jobs: This is a pull request automatically created by a Github Action to format the code. If there is any conflict, click the run workflow button on - [this page](https://github.com/keras-team/keras/actions/workflows/format.yml). + [this page](https://github.com/keras-team/tf-keras/actions/workflows/format.yml). labels: | ready to pull draft: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7dc9fe96e..6164fda58 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,7 +56,7 @@ pull request. A team member will take care of the merging. ![Ready to pull](https://i.imgur.com/yCEqJsA.png) -Here is an [example pull request](https://github.com/keras-team/keras/pull/15015) +Here is an [example pull request](https://github.com/keras-team/tf-keras/pull/15015) for your reference. ## Setup environment @@ -68,7 +68,7 @@ to setup a local environment by installing the dev tools needed. ### Option 1: Use a Docker container We provide a -[Dockerfile](https://github.com/keras-team/keras/blob/master/.devcontainer/Dockerfile) +[Dockerfile](https://github.com/keras-team/tf-keras/blob/master/.devcontainer/Dockerfile) to build the dev environment. You can build the Dockerfile into a Docker image named `keras-dev` with the following command at the root directory of your cloned repo. @@ -79,18 +79,18 @@ docker build -t keras-dev .devcontainer You can launch a Docker container from the image with the following command. The `-it` option gives you an interactive shell of the container. The `-v -path/to/repo/:/home/keras/` mounts your cloned repo to the container. Replace +path/to/repo/:/home/tf_keras/` mounts your cloned repo to the container. Replace `path/to/repo` with the path to your cloned repo directory. ```shell -docker run -it -v path/to/repo/:/home/keras/ keras-dev +docker run -it -v path/to/repo/:/home/tf_keras/ keras-dev ``` In the container shell, you need to install the latest dependencies with the following command. ```shell -pip install -r /home/keras/requirements.txt && pip uninstall keras-nightly -y +pip install -r /home/tf_keras/requirements.txt && pip uninstall keras-nightly -y ``` Now, the environment setup is complete. You are ready to run the tests. @@ -107,14 +107,14 @@ with setup instructions. To setup your local dev environment, you will need the following tools. -1. [Bazel](https://bazel.build/) is the tool to build and test Keras. See the +1. [Bazel](https://bazel.build/) is the tool to build and test TF-Keras. See the [installation guide](https://docs.bazel.build/versions/4.0.0/install.html) for how to install and config bazel for your local environment. 2. [git](https://github.com/) for code repository management. -3. [python](https://www.python.org/) to build and code in Keras. +3. [python](https://www.python.org/) to build and code in TF-Keras. The following commands check the tools above are successfully installed. Note -that Keras requires at least Python 3.7 to run. +that TF-Keras requires at least Python 3.7 to run. ```shell bazel --version @@ -146,7 +146,7 @@ venv_dir\Scripts\activate.bat # for Windows Clone your forked repo to your local machine. Go to the cloned directory to install the dependencies into the venv. Since `tf-nightly` uses `keras-nightly` as a dependency, we need to uninstall `keras-nightly` so that tests will run -against Keras code in the local workspace. +against TF-Keras code in the local workspace. ```shell git clone https://github.com/YOUR_GITHUB_USERNAME/keras.git @@ -165,9 +165,9 @@ pip install --upgrade tf-nightly ## Code style -The Keras uses [Black](https://black.readthedocs.io/en/stable/) and +The TF-Keras uses [Black](https://black.readthedocs.io/en/stable/) and [isort](https://pycqa.github.io/isort/) to format the code. Please refer to -[requirements.txt](https://github.com/keras-team/keras/blob/master/requirements.txt) +[requirements.txt](https://github.com/keras-team/tf-keras/blob/master/requirements.txt) for the required versions. Run the following command **at the root directory of the repo** to format your code. @@ -199,7 +199,7 @@ A **class docstring** may contain the following items: * Optional `Raises` section for possible errors. You can check out `MultiHeadAttention` as an example -[(link)](https://github.com/keras-team/keras/blob/v2.12.0-rc1/keras/layers/attention/multi_head_attention.py#L131). +[(link)](https://github.com/keras-team/tf-keras/blob/v2.12.0-rc1/tf_keras/layers/attention/multi_head_attention.py#L131). A **function docstring** may contain the following items: @@ -211,7 +211,7 @@ A **function docstring** may contain the following items: * Optional `Raises` section for possible errors. You can check out `text_dataset_from_directory` as an example -[(link)](https://github.com/keras-team/keras/blob/v2.12.0-rc1/keras/utils/text_dataset.py#L31). +[(link)](https://github.com/keras-team/tf-keras/blob/v2.12.0-rc1/tf_keras/utils/text_dataset.py#L31). ## Run tests @@ -267,22 +267,22 @@ command above. However, it may slow down the tests for not running in parallel and may cause the test to timeout. -## Contributing to Keras applications +## Contributing to TF-Keras applications Contributions to the [pre-trained application library](https://keras.io/api/applications/) are -welcome. Code for Keras applications is located in Keras repository in -[keras/applications](https://github.com/keras-team/keras/blob/master/keras/applications). -When contributing to Keras applications, please keep following checklist in +welcome. Code for TF-Keras applications is located in TF-Keras repository in +[keras/applications](https://github.com/keras-team/tf-keras/blob/master/tf_keras/applications). +When contributing to TF-Keras applications, please keep following checklist in mind. -- Keras applications must implement an established and widely used model. +- TF-Keras applications must implement an established and widely used model. Applications should include a link to a paper describing the architecture of the model with at least 20 citations. - Applications should be provided with pre-trained weights. - - When submitting a pull request for a Keras application, these weights + - When submitting a pull request for a TF-Keras application, these weights can be provided at any publically available URL (e.g. a personal Cloud - Storage bucket). The weights will be uploaded to a Keras storage bucket + Storage bucket). The weights will be uploaded to a TF-Keras storage bucket while merging the pull request. - Weights should be downloaded with the [get_file()](https://keras.io/api/utils/python_utils/#getfile-function) @@ -312,5 +312,5 @@ mind. ## Security vulnerability reports -Since Keras is the high-level API of TensorFlow 2, Keras follows same security practices as TensorFlow. +Since TF-Keras is the high-level API of TensorFlow 2, TF-Keras follows same security practices as TensorFlow. For details on guidelines on vulnerabilities and reporting them, you can refer [Using TensorFlow Securely](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md). diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index e87fa9323..e0166f4da 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -8,7 +8,7 @@ If you open a GitHub issue, here is our policy: documentation (for small docs fixes please send a PR instead). 2. The form below must be filled out. -**Here's why we have that policy**: Keras developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow. +**Here's why we have that policy**: TF-Keras developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow. ------------------------ @@ -35,7 +35,7 @@ python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VER ``` ### Describe the problem -Describe the problem clearly here. Be sure to convey here why it's a bug in Keras or why the requested feature is needed. +Describe the problem clearly here. Be sure to convey here why it's a bug in TF-Keras or why the requested feature is needed. ### Source code / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. diff --git a/README.md b/README.md index dfbe16088..30855af00 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![Keras logo](https://s3.amazonaws.com/keras.io/img/keras-logo-2018-large-1200.png) -This repository hosts the development of the Keras library. +This repository hosts the development of the TF-Keras library. Read the documentation at [keras.io](https://keras.io/). ## About Keras @@ -12,26 +12,26 @@ running on top of the machine learning platform [TensorFlow](https://github.com/ It was developed with a focus on enabling fast experimentation and providing a delightful developer experience. -**The purpose of Keras is to give an *unfair advantage* to any developer looking to ship ML-powered apps.** +**The purpose of TF-Keras is to give an *unfair advantage* to any developer looking to ship ML-powered apps.** Keras is: -- **Simple** -- but not simplistic. Keras reduces developer *cognitive load* +- **Simple** -- but not simplistic. TF-Keras reduces developer *cognitive load* to free you to focus on the parts of the problem that really matter. - Keras focuses on ease of use, debugging speed, code elegance & conciseness, + TF-Keras focuses on ease of use, debugging speed, code elegance & conciseness, maintainability, and deployability (via TFServing, TFLite, TF.js). -- **Flexible** -- Keras adopts the principle of *progressive disclosure of +- **Flexible** -- TF-Keras adopts the principle of *progressive disclosure of complexity*: simple workflows should be quick and easy, while arbitrarily advanced workflows should be *possible* via a clear path that builds upon what you've already learned. -- **Powerful** -- Keras provides industry-strength performance and +- **Powerful** -- TF-Keras provides industry-strength performance and scalability: it is used by organizations and companies including NASA, YouTube, and Waymo. That's right -- your YouTube recommendations are powered by Keras, and so is the world's most advanced driverless vehicle. --- -## Keras & TensorFlow 2 +## TF-Keras & TensorFlow 2 [TensorFlow 2](https://www.tensorflow.org/) is an end-to-end, open-source machine learning platform. You can think of it as an infrastructure layer for @@ -49,14 +49,14 @@ with a focus on modern deep learning. It provides essential abstractions and bui and shipping machine learning solutions with high iteration velocity. Keras empowers engineers and researchers to take full advantage of the scalability -and cross-platform capabilities of TensorFlow 2: you can run Keras on TPU or on large clusters of GPUs, -and you can export your Keras models to run in the browser or on a mobile device. +and cross-platform capabilities of TensorFlow 2: you can run TF-Keras on TPU or on large clusters of GPUs, +and you can export your TF-Keras models to run in the browser or on a mobile device. --- ## First contact with Keras -The core data structures of Keras are __layers__ and __models__. +The core data structures of TF-Keras are __layers__ and __models__. The simplest type of model is the [`Sequential` model](https://keras.io/guides/sequential_model/), a linear stack of layers. For more complex architectures, you should use the [Keras functional API](https://keras.io/guides/functional_api/), which allows you to build arbitrary graphs of layers or [write models entirely from scratch via subclassing](https://keras.io/guides/making_new_layers_and_models_via_subclassing/). @@ -86,7 +86,7 @@ model.compile(loss='categorical_crossentropy', metrics=['accuracy']) ``` -If you need to, you can further configure your optimizer. The Keras philosophy is to keep simple things simple, +If you need to, you can further configure your optimizer. The TF-Keras philosophy is to keep simple things simple, while allowing the user to be fully in control when they need to be (the ultimate control being the easy extensibility of the source code via subclassing). ```python @@ -114,16 +114,16 @@ Or generate predictions on new data: classes = model.predict(x_test, batch_size=128) ``` -What you just saw is the most elementary way to use Keras. +What you just saw is the most elementary way to use TF-Keras. -However, Keras is also a highly-flexible framework suitable to iterate on state-of-the-art research ideas. +However, TF-Keras is also a highly-flexible framework suitable to iterate on state-of-the-art research ideas. Keras follows the principle of **progressive disclosure of complexity**: it makes it easy to get started, yet it makes it possible to handle arbitrarily advanced use cases, only requiring incremental learning at each step. In pretty much the same way that you were able to train & evaluate a simple neural network above in a few lines, -you can use Keras to quickly develop new training procedures or exotic model architectures. -Here's a low-level training loop example, combining Keras functionality with the TensorFlow `GradientTape`: +you can use TF-Keras to quickly develop new training procedures or exotic model architectures. +Here's a low-level training loop example, combining TF-Keras functionality with the TensorFlow `GradientTape`: ```python import tensorflow as tf @@ -150,8 +150,8 @@ for inputs, targets in dataset: For more in-depth tutorials about Keras, you can check out: -- [Introduction to Keras for engineers](https://keras.io/getting_started/intro_to_keras_for_engineers/) -- [Introduction to Keras for researchers](https://keras.io/getting_started/intro_to_keras_for_researchers/) +- [Introduction to TF-Keras for engineers](https://keras.io/getting_started/intro_to_keras_for_engineers/) +- [Introduction to TF-Keras for researchers](https://keras.io/getting_started/intro_to_keras_for_researchers/) - [Developer guides](https://keras.io/guides/) - [Other learning resources](https://keras.io/getting_started/learning_resources/) @@ -161,10 +161,10 @@ For more in-depth tutorials about Keras, you can check out: Keras comes packaged with TensorFlow 2 as `tensorflow.keras`. To start using Keras, simply [install TensorFlow 2](https://www.tensorflow.org/install). -You can then import Keras as follows: +You can then import TF-Keras as follows: ```python -from tensorflow import keras +from tensorflow import tf_keras as keras ``` --- @@ -173,7 +173,7 @@ from tensorflow import keras Keras has **nightly releases** (`keras-nightly` on PyPI) and **stable releases** (`keras` on PyPI). -The nightly Keras releases are usually compatible with the corresponding version +The nightly TF-Keras releases are usually compatible with the corresponding version of the `tf-nightly` releases (e.g. `keras-nightly==2.7.0.dev2021100607` should be used with `tf-nightly==2.7.0.dev2021100607`). @@ -182,11 +182,11 @@ For stable releases, each Keras version maps to a specific stable version of TensorFlow. The table below shows the compatibility version mapping -between TensorFlow versions and Keras versions. +between TensorFlow versions and TF-Keras versions. -All the release branches can be found on [GitHub](https://github.com/keras-team/keras/releases). +All the release branches can be found on [GitHub](https://github.com/keras-team/tf-keras/releases). -All the release binaries can be found on [Pypi](https://pypi.org/project/keras/#history). +All the release binaries can be found on [Pypi](https://pypi.org/project/tf_keras/#history). --- ## Support @@ -201,7 +201,7 @@ You can ask questions and join the development discussion: ## Opening an issue You can also post **bug reports and feature requests** (only) -in [GitHub issues](https://github.com/keras-team/keras/issues). +in [GitHub issues](https://github.com/keras-team/tf-keras/issues). --- @@ -209,5 +209,5 @@ in [GitHub issues](https://github.com/keras-team/keras/issues). ## Opening a PR We welcome contributions! Before opening a PR, please read -[our contributor guide](https://github.com/keras-team/keras/blob/master/CONTRIBUTING.md), +[our contributor guide](https://github.com/keras-team/tf-keras/blob/master/CONTRIBUTING.md), and the [API design guideline](https://github.com/keras-team/governance/blob/master/keras_api_design_guidelines.md). diff --git a/keras/api/BUILD b/keras/api/BUILD deleted file mode 100644 index 3bcfc7a2d..000000000 --- a/keras/api/BUILD +++ /dev/null @@ -1,199 +0,0 @@ -# Description: -# Package for Keras. - -# Placeholder: load unaliased py_library -load("//keras/api:api_gen.bzl", "gen_api_init_files") -load("//keras/api:api_init_files.bzl", "KERAS_API_INIT_FILES", "KERAS_API_INIT_FILES_V1") - -package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], - default_visibility = [ - "//keras:friends", - "//third_party/py/tensorflow:__subpackages__", - ], - licenses = ["notice"], # Apache 2.0 License -) - -exports_files( - [ - "create_python_api_wrapper.py", - ], -) - -keras_packages = [ - "keras", - "keras.activations", - "keras.applications.convnext", - "keras.applications.densenet", - "keras.applications.efficientnet", - "keras.applications.efficientnet_v2", - "keras.applications.imagenet_utils", - "keras.applications.inception_resnet_v2", - "keras.applications.inception_v3", - "keras.applications.mobilenet", - "keras.applications.mobilenet_v2", - "keras.applications.mobilenet_v3", - "keras.applications.nasnet", - "keras.applications.regnet", - "keras.applications.resnet", - "keras.applications.resnet_v2", - "keras.applications.resnet_rs", - "keras.applications.vgg16", - "keras.applications.vgg19", - "keras.applications.xception", - "keras.backend", - "keras.backend_config", - "keras.callbacks", - "keras.callbacks_v1", - "keras.constraints", - "keras.datasets.boston_housing", - "keras.datasets.cifar10", - "keras.datasets.cifar100", - "keras.datasets.fashion_mnist", - "keras.datasets.imdb", - "keras.datasets.mnist", - "keras.datasets.reuters", - "keras.dtensor.layout_map", - "keras.engine.base_layer", - "keras.engine.data_adapter", - "keras.engine.input_layer", - "keras.engine.input_spec", - "keras.engine.sequential", - "keras.engine.training", - "keras.estimator", - "keras.export.export_lib", - "keras.feature_column.dense_features", - "keras.feature_column.dense_features_v2", - "keras.feature_column.sequence_feature_column", - # Placeholder for internal API - "keras.initializers", - "keras.initializers.initializers", - "keras.initializers.initializers_v1", - "keras.layers.activation", - "keras.layers.attention", - "keras.layers.convolutional", - "keras.layers.core", - "keras.layers.locally_connected", - "keras.layers.merging", - "keras.layers.normalization", - "keras.layers.preprocessing", - "keras.layers.pooling", - "keras.layers.regularization", - "keras.layers.rnn", - "keras.layers.rnn.legacy_cell_wrappers", - "keras.layers.rnn.legacy_cells", - "keras.layers.serialization", - "keras.legacy_tf_layers.base", - "keras.legacy_tf_layers.convolutional", - "keras.legacy_tf_layers.core", - "keras.legacy_tf_layers.normalization", - "keras.legacy_tf_layers.pooling", - "keras.losses", - "keras.metrics", - "keras.mixed_precision.loss_scale_optimizer", - "keras.mixed_precision.policy", - "keras.models", - "keras.optimizers.adadelta", - "keras.optimizers.adagrad", - "keras.optimizers.adam", - "keras.optimizers.adamax", - "keras.optimizers.ftrl", - "keras.optimizers.nadam", - "keras.optimizers.sgd", - "keras.optimizers.optimizer", - "keras.optimizers.rmsprop", - "keras.optimizers.legacy.adadelta", - "keras.optimizers.legacy.adagrad", - "keras.optimizers.legacy.adam", - "keras.optimizers.legacy.adamax", - "keras.optimizers.legacy.ftrl", - "keras.optimizers.legacy.gradient_descent", - "keras.optimizers.legacy.nadam", - "keras.optimizers.legacy.optimizer_v2", - "keras.optimizers.legacy.rmsprop", - "keras.optimizers.schedules.learning_rate_schedule", - "keras.optimizers", - "keras.premade_models.linear", - "keras.premade_models.wide_deep", - "keras.preprocessing.image", - "keras.preprocessing.sequence", - "keras.preprocessing.text", - "keras.regularizers", - "keras.saving.legacy.model_config", - "keras.saving.legacy.save", - "keras.saving.legacy.serialization", - "keras.testing_infra.test_utils", - "keras.utils.data_utils", - "keras.utils.generic_utils", - "keras.utils.io_utils", - "keras.utils.layer_utils", - "keras.utils.losses_utils", - "keras.utils.np_utils", - "keras.utils.tf_utils", - "keras.utils.vis_utils", -] - -# The target used by PIP package which need to generate API init files during OSS build. -py_library( - name = "keras_api", - srcs = [ - ":keras_python_api_gen", - ":keras_python_api_gen_compat_v1", - ":keras_python_api_gen_compat_v2", - ], - srcs_version = "PY3", - deps = [ - "//:expect_tensorflow_installed", - "//keras", - ], -) - -gen_api_init_files( - name = "keras_python_api_gen", - api_name = "keras", - api_version = 1, - output_files = KERAS_API_INIT_FILES_V1, - output_package = "keras.api", - package_deps = [ - "//keras", - "//:expect_tensorflow_installed", - # "//third_party/tensorflow/lite/python:analyzer", - # "//third_party/tensorflow/lite/python:lite", - # "//third_party/tensorflow/lite/python/authoring", - ], - packages = keras_packages, -) - -gen_api_init_files( - name = "keras_python_api_gen_compat_v1", - api_name = "keras", - api_version = 1, - output_dir = "_v1/", - output_files = KERAS_API_INIT_FILES_V1, - output_package = "keras.api._v1", - package_deps = [ - "//keras", - "//:expect_tensorflow_installed", - # "//third_party/tensorflow/lite/python:analyzer", - # "//third_party/tensorflow/lite/python:lite", - # "//third_party/tensorflow/lite/python/authoring", - ], - packages = keras_packages, -) - -gen_api_init_files( - name = "keras_python_api_gen_compat_v2", - api_name = "keras", - api_version = 2, - output_dir = "_v2/", - output_files = KERAS_API_INIT_FILES, - output_package = "keras.api._v2", - package_deps = [ - "//keras", - "//:expect_tensorflow_installed", - # "//third_party/tensorflow/lite/python:analyzer", - # "//third_party/tensorflow/lite/python:lite", - # "//third_party/tensorflow/lite/python/authoring", - ], - packages = keras_packages, -) diff --git a/keras/api/api_gen.bzl b/keras/api/api_gen.bzl deleted file mode 100644 index f0d0cc067..000000000 --- a/keras/api/api_gen.bzl +++ /dev/null @@ -1,130 +0,0 @@ -"""Targets for generating Keras API __init__.py files. - -This bzl file is copied with slight modifications from -tensorflow/python/tools/api/generator/api_gen.bzl -so that we can avoid needing to depend on TF source code in Bazel build. - -It should be noted that because this file is executed during the build, -and it imports TensorFlow code, that installing TensorFlow python package -is required to Bazel build Keras. -""" - -load("@org_keras//keras:keras.bzl", "if_indexing_source_code") -# Placeholder: load aliased py_binary - -def gen_api_init_files( - name, - output_files, - root_init_template = None, - srcs = [], - api_name = "keras", - api_version = 2, - compat_api_versions = [], - compat_init_templates = [], - packages = ["keras"], - package_deps = [ - "//keras:keras", - ], - output_package = "keras.api", - output_dir = "", - root_file_name = "__init__.py"): - """Creates API directory structure and __init__.py files. - - Creates a genrule that generates a directory structure with __init__.py - files that import all exported modules (i.e. modules with tf_export - decorators). - - Args: - name: name of genrule to create. - output_files: List of __init__.py files that should be generated. - This list should include file name for every module exported using - tf_export. For e.g. if an op is decorated with - @tf_export('module1.module2', 'module3'). Then, output_files should - include module1/module2/__init__.py and module3/__init__.py. - root_init_template: Python init file that should be used as template for - root __init__.py file. "# API IMPORTS PLACEHOLDER" comment inside this - template will be replaced with root imports collected by this genrule. - srcs: genrule sources. If passing root_init_template, the template file - must be included in sources. - api_name: Name of the project that you want to generate API files for - (e.g. "tensorflow" or "estimator"). - api_version: TensorFlow API version to generate. Must be either 1 or 2. - compat_api_versions: Older TensorFlow API versions to generate under - compat/ directory. - compat_init_templates: Python init file that should be used as template - for top level __init__.py files under compat/vN directories. - "# API IMPORTS PLACEHOLDER" comment inside this - template will be replaced with root imports collected by this genrule. - packages: Python packages containing the @tf_export decorators you want to - process - package_deps: Python library target containing your packages. - output_package: Package where generated API will be added to. - output_dir: Subdirectory to output API to. - If non-empty, must end with '/'. - root_file_name: Name of the root file with all the root imports. - """ - root_init_template_flag = "" - if root_init_template: - root_init_template_flag = "--root_init_template=$(location " + root_init_template + ")" - - primary_package = packages[0] - api_gen_binary_target = ("create_" + primary_package + "_api_%d_%s") % (api_version, name) - native.py_binary( - name = api_gen_binary_target, - srcs = ["//keras/api:create_python_api_wrapper.py"], - main = "//keras/api:create_python_api_wrapper.py", - python_version = "PY3", - srcs_version = "PY2AND3", - visibility = ["//visibility:public"], - deps = package_deps, - ) - - # Replace name of root file with root_file_name. - output_files = [ - root_file_name if f == "__init__.py" else f - for f in output_files - ] - all_output_files = ["%s%s" % (output_dir, f) for f in output_files] - compat_api_version_flags = "" - for compat_api_version in compat_api_versions: - compat_api_version_flags += " --compat_apiversion=%d" % compat_api_version - - compat_init_template_flags = "" - for compat_init_template in compat_init_templates: - compat_init_template_flags += ( - " --compat_init_template=$(location %s)" % compat_init_template - ) - - # The Keras package within tf project is accessible via both paths below - # Disable them for now so that we don't get SymbolExposedTwiceError - # from create_python_api.py - packages_to_ignore = ["tensorflow.python.keras", "tensorflow.keras"] - - flags = [ - root_init_template_flag, - "--apidir=$(@D)" + output_dir, - "--apiname=" + api_name, - "--apiversion=" + str(api_version), - compat_api_version_flags, - compat_init_template_flags, - "--packages=" + ",".join(packages), - "--packages_to_ignore=" + ",".join(packages_to_ignore), - "--output_package=" + output_package, - ] - - native.genrule( - name = name, - outs = all_output_files, - cmd = if_indexing_source_code( - _make_cmd(api_gen_binary_target, flags, loading = "static"), - _make_cmd(api_gen_binary_target, flags, loading = "default"), - ), - srcs = srcs, - tools = [":" + api_gen_binary_target], - visibility = ["//visibility:public"], - ) - -def _make_cmd(api_gen_binary_target, flags, loading = "default"): - binary = "$(location :" + api_gen_binary_target + ")" - flags.append("--loading=" + loading) - return " ".join([binary] + flags + ["$(OUTS)"]) diff --git a/keras/api/create_python_api_wrapper.py b/keras/api/create_python_api_wrapper.py deleted file mode 100644 index c02c26e2c..000000000 --- a/keras/api/create_python_api_wrapper.py +++ /dev/null @@ -1,34 +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. -# ============================================================================== -"""Thin wrapper to call TensorFlow's API generation script. - -This file exists to provide a main function for the py_binary in the API -generation genrule. It just calls the main function for the actual API -generation script in TensorFlow. -""" - -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function - -import keras # noqa: F401 - -# isort: off -from tensorflow.python.tools.api.generator import ( - create_python_api, -) - -if __name__ == "__main__": - create_python_api.main() diff --git a/keras/applications/__init__.py b/keras/applications/__init__.py deleted file mode 100644 index c08ee2843..000000000 --- a/keras/applications/__init__.py +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 2016 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. -# ============================================================================== -"""Keras Applications are premade architectures with pre-trained weights.""" - - -from keras.applications.convnext import ConvNeXtBase -from keras.applications.convnext import ConvNeXtLarge -from keras.applications.convnext import ConvNeXtSmall -from keras.applications.convnext import ConvNeXtTiny -from keras.applications.convnext import ConvNeXtXLarge -from keras.applications.densenet import DenseNet121 -from keras.applications.densenet import DenseNet169 -from keras.applications.densenet import DenseNet201 -from keras.applications.efficientnet import EfficientNetB0 -from keras.applications.efficientnet import EfficientNetB1 -from keras.applications.efficientnet import EfficientNetB2 -from keras.applications.efficientnet import EfficientNetB3 -from keras.applications.efficientnet import EfficientNetB4 -from keras.applications.efficientnet import EfficientNetB5 -from keras.applications.efficientnet import EfficientNetB6 -from keras.applications.efficientnet import EfficientNetB7 -from keras.applications.efficientnet_v2 import EfficientNetV2B0 -from keras.applications.efficientnet_v2 import EfficientNetV2B1 -from keras.applications.efficientnet_v2 import EfficientNetV2B2 -from keras.applications.efficientnet_v2 import EfficientNetV2B3 -from keras.applications.efficientnet_v2 import EfficientNetV2L -from keras.applications.efficientnet_v2 import EfficientNetV2M -from keras.applications.efficientnet_v2 import EfficientNetV2S -from keras.applications.inception_resnet_v2 import InceptionResNetV2 -from keras.applications.inception_v3 import InceptionV3 -from keras.applications.mobilenet import MobileNet -from keras.applications.mobilenet_v2 import MobileNetV2 -from keras.applications.mobilenet_v3 import MobileNetV3Large -from keras.applications.mobilenet_v3 import MobileNetV3Small -from keras.applications.nasnet import NASNetLarge -from keras.applications.nasnet import NASNetMobile -from keras.applications.resnet import ResNet50 -from keras.applications.resnet import ResNet101 -from keras.applications.resnet import ResNet152 -from keras.applications.resnet_rs import ResNetRS50 -from keras.applications.resnet_rs import ResNetRS101 -from keras.applications.resnet_rs import ResNetRS152 -from keras.applications.resnet_rs import ResNetRS200 -from keras.applications.resnet_rs import ResNetRS270 -from keras.applications.resnet_rs import ResNetRS350 -from keras.applications.resnet_rs import ResNetRS420 -from keras.applications.resnet_v2 import ResNet50V2 -from keras.applications.resnet_v2 import ResNet101V2 -from keras.applications.resnet_v2 import ResNet152V2 -from keras.applications.vgg16 import VGG16 -from keras.applications.vgg19 import VGG19 -from keras.applications.xception import Xception diff --git a/keras/benchmarks/README.md b/keras/benchmarks/README.md deleted file mode 100644 index 17e458b3a..000000000 --- a/keras/benchmarks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Keras Benchmark - -This package contains benchmarks on Keras models and components. diff --git a/keras/distribute/README.md b/keras/distribute/README.md deleted file mode 100644 index 0c83d2c9e..000000000 --- a/keras/distribute/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Keras with Distribution Strategy Tests - -This directory contains unit tests that combine Keras library with -[Distribution Training](https://www.tensorflow.org/guide/distributed_training). -Tests that use a custom training loop instead of Keras compile/fit should be -placed under python/distribute directory instead. diff --git a/keras/layers/__init__.py b/keras/layers/__init__.py deleted file mode 100644 index 6812e92aa..000000000 --- a/keras/layers/__init__.py +++ /dev/null @@ -1,292 +0,0 @@ -# Copyright 2016 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. -# ============================================================================== -"""Keras layers API.""" - -# isort: off -import tensorflow.compat.v2 as tf - -from keras.engine.base_layer import Layer -from keras.engine.base_preprocessing_layer import PreprocessingLayer - -# Generic layers. -from keras.engine.input_layer import Input -from keras.engine.input_layer import InputLayer -from keras.engine.input_spec import InputSpec -from keras.layers.activation.elu import ELU -from keras.layers.activation.leaky_relu import LeakyReLU -from keras.layers.activation.prelu import PReLU - -# Activations layers. -from keras.layers.activation.relu import ReLU -from keras.layers.activation.softmax import Softmax -from keras.layers.activation.thresholded_relu import ThresholdedReLU -from keras.layers.attention.additive_attention import AdditiveAttention -from keras.layers.attention.attention import Attention - -# Attention layers. -from keras.layers.attention.multi_head_attention import MultiHeadAttention - -# Convolution layer aliases. -# Convolution layers. -from keras.layers.convolutional.conv1d import Conv1D -from keras.layers.convolutional.conv1d import Convolution1D -from keras.layers.convolutional.conv1d_transpose import Conv1DTranspose -from keras.layers.convolutional.conv1d_transpose import Convolution1DTranspose -from keras.layers.convolutional.conv2d import Conv2D -from keras.layers.convolutional.conv2d import Convolution2D -from keras.layers.convolutional.conv2d_transpose import Conv2DTranspose -from keras.layers.convolutional.conv2d_transpose import Convolution2DTranspose -from keras.layers.convolutional.conv3d import Conv3D -from keras.layers.convolutional.conv3d import Convolution3D -from keras.layers.convolutional.conv3d_transpose import Conv3DTranspose -from keras.layers.convolutional.conv3d_transpose import Convolution3DTranspose -from keras.layers.convolutional.depthwise_conv1d import DepthwiseConv1D -from keras.layers.convolutional.depthwise_conv2d import DepthwiseConv2D -from keras.layers.convolutional.separable_conv1d import SeparableConv1D -from keras.layers.convolutional.separable_conv1d import SeparableConvolution1D -from keras.layers.convolutional.separable_conv2d import SeparableConv2D -from keras.layers.convolutional.separable_conv2d import SeparableConvolution2D - -# Core layers. -from keras.layers.core.activation import Activation -from keras.layers.core.dense import Dense -from keras.layers.core.einsum_dense import EinsumDense -from keras.layers.core.embedding import Embedding -from keras.layers.core.identity import Identity -from keras.layers.core.lambda_layer import Lambda -from keras.layers.core.masking import Masking -from keras.layers.core.tf_op_layer import ClassMethod -from keras.layers.core.tf_op_layer import InstanceMethod -from keras.layers.core.tf_op_layer import InstanceProperty -from keras.layers.core.tf_op_layer import SlicingOpLambda -from keras.layers.core.tf_op_layer import TFOpLambda - -# Locally-connected layers. -from keras.layers.locally_connected.locally_connected1d import ( - LocallyConnected1D, -) -from keras.layers.locally_connected.locally_connected2d import ( - LocallyConnected2D, -) - -# Merging functions. -# Merging layers. -from keras.layers.merging.add import Add -from keras.layers.merging.add import add -from keras.layers.merging.average import Average -from keras.layers.merging.average import average -from keras.layers.merging.concatenate import Concatenate -from keras.layers.merging.concatenate import concatenate -from keras.layers.merging.dot import Dot -from keras.layers.merging.dot import dot -from keras.layers.merging.maximum import Maximum -from keras.layers.merging.maximum import maximum -from keras.layers.merging.minimum import Minimum -from keras.layers.merging.minimum import minimum -from keras.layers.merging.multiply import Multiply -from keras.layers.merging.multiply import multiply -from keras.layers.merging.subtract import Subtract -from keras.layers.merging.subtract import subtract -from keras.layers.normalization.batch_normalization import ( - SyncBatchNormalization, -) - -# Normalization layers. -from keras.layers.normalization.group_normalization import GroupNormalization -from keras.layers.normalization.layer_normalization import LayerNormalization -from keras.layers.normalization.unit_normalization import UnitNormalization -from keras.layers.normalization.spectral_normalization import ( - SpectralNormalization, -) # noqa: E501 - -# Preprocessing layers. -from keras.layers.preprocessing.category_encoding import CategoryEncoding -from keras.layers.preprocessing.discretization import Discretization -from keras.layers.preprocessing.hashed_crossing import HashedCrossing -from keras.layers.preprocessing.hashing import Hashing - -# Image preprocessing layers. -from keras.layers.preprocessing.image_preprocessing import CenterCrop -from keras.layers.preprocessing.image_preprocessing import RandomBrightness -from keras.layers.preprocessing.image_preprocessing import RandomContrast -from keras.layers.preprocessing.image_preprocessing import RandomCrop -from keras.layers.preprocessing.image_preprocessing import RandomFlip -from keras.layers.preprocessing.image_preprocessing import RandomHeight -from keras.layers.preprocessing.image_preprocessing import RandomRotation -from keras.layers.preprocessing.image_preprocessing import RandomTranslation -from keras.layers.preprocessing.image_preprocessing import RandomWidth -from keras.layers.preprocessing.image_preprocessing import RandomZoom -from keras.layers.preprocessing.image_preprocessing import Rescaling -from keras.layers.preprocessing.image_preprocessing import Resizing -from keras.layers.preprocessing.integer_lookup import IntegerLookup -from keras.layers.preprocessing.normalization import Normalization -from keras.layers.preprocessing.string_lookup import StringLookup -from keras.layers.preprocessing.text_vectorization import TextVectorization -from keras.layers.regularization.activity_regularization import ( - ActivityRegularization, -) -from keras.layers.regularization.alpha_dropout import AlphaDropout - -# Regularization layers. -from keras.layers.regularization.dropout import Dropout -from keras.layers.regularization.gaussian_dropout import GaussianDropout -from keras.layers.regularization.gaussian_noise import GaussianNoise -from keras.layers.regularization.spatial_dropout1d import SpatialDropout1D -from keras.layers.regularization.spatial_dropout2d import SpatialDropout2D -from keras.layers.regularization.spatial_dropout3d import SpatialDropout3D - -# Reshaping layers. -from keras.layers.reshaping.cropping1d import Cropping1D -from keras.layers.reshaping.cropping2d import Cropping2D -from keras.layers.reshaping.cropping3d import Cropping3D -from keras.layers.reshaping.flatten import Flatten -from keras.layers.reshaping.permute import Permute -from keras.layers.reshaping.repeat_vector import RepeatVector -from keras.layers.reshaping.reshape import Reshape -from keras.layers.reshaping.up_sampling1d import UpSampling1D -from keras.layers.reshaping.up_sampling2d import UpSampling2D -from keras.layers.reshaping.up_sampling3d import UpSampling3D -from keras.layers.reshaping.zero_padding1d import ZeroPadding1D -from keras.layers.reshaping.zero_padding2d import ZeroPadding2D -from keras.layers.reshaping.zero_padding3d import ZeroPadding3D - -if tf.__internal__.tf2.enabled(): - from keras.layers.normalization.batch_normalization import ( - BatchNormalization, - ) - from keras.layers.normalization.batch_normalization_v1 import ( - BatchNormalization as BatchNormalizationV1, - ) - - BatchNormalizationV2 = BatchNormalization -else: - from keras.layers.normalization.batch_normalization import ( - BatchNormalization as BatchNormalizationV2, - ) - from keras.layers.normalization.batch_normalization_v1 import ( - BatchNormalization, - ) - - BatchNormalizationV1 = BatchNormalization - -# Kernelized layers. -from keras.layers.kernelized import RandomFourierFeatures - -# Pooling layer aliases. -# Pooling layers. -from keras.layers.pooling.average_pooling1d import AveragePooling1D -from keras.layers.pooling.average_pooling1d import AvgPool1D -from keras.layers.pooling.average_pooling2d import AveragePooling2D -from keras.layers.pooling.average_pooling2d import AvgPool2D -from keras.layers.pooling.average_pooling3d import AveragePooling3D -from keras.layers.pooling.average_pooling3d import AvgPool3D -from keras.layers.pooling.global_average_pooling1d import GlobalAveragePooling1D -from keras.layers.pooling.global_average_pooling1d import GlobalAvgPool1D -from keras.layers.pooling.global_average_pooling2d import GlobalAveragePooling2D -from keras.layers.pooling.global_average_pooling2d import GlobalAvgPool2D -from keras.layers.pooling.global_average_pooling3d import GlobalAveragePooling3D -from keras.layers.pooling.global_average_pooling3d import GlobalAvgPool3D -from keras.layers.pooling.global_max_pooling1d import GlobalMaxPool1D -from keras.layers.pooling.global_max_pooling1d import GlobalMaxPooling1D -from keras.layers.pooling.global_max_pooling2d import GlobalMaxPool2D -from keras.layers.pooling.global_max_pooling2d import GlobalMaxPooling2D -from keras.layers.pooling.global_max_pooling3d import GlobalMaxPool3D -from keras.layers.pooling.global_max_pooling3d import GlobalMaxPooling3D -from keras.layers.pooling.max_pooling1d import MaxPool1D -from keras.layers.pooling.max_pooling1d import MaxPooling1D -from keras.layers.pooling.max_pooling2d import MaxPool2D -from keras.layers.pooling.max_pooling2d import MaxPooling2D -from keras.layers.pooling.max_pooling3d import MaxPool3D -from keras.layers.pooling.max_pooling3d import MaxPooling3D -from keras.layers.rnn.abstract_rnn_cell import AbstractRNNCell - -# Recurrent layers. -from keras.layers.rnn.base_rnn import RNN -from keras.layers.rnn.simple_rnn import SimpleRNN -from keras.layers.rnn.simple_rnn import SimpleRNNCell -from keras.layers.rnn.stacked_rnn_cells import StackedRNNCells - -if tf.__internal__.tf2.enabled(): - from keras.layers.rnn.gru import GRU - from keras.layers.rnn.gru import GRUCell - from keras.layers.rnn.gru_v1 import GRU as GRUV1 - from keras.layers.rnn.gru_v1 import GRUCell as GRUCellV1 - from keras.layers.rnn.lstm import LSTM - from keras.layers.rnn.lstm import LSTMCell - from keras.layers.rnn.lstm_v1 import LSTM as LSTMV1 - from keras.layers.rnn.lstm_v1 import LSTMCell as LSTMCellV1 - - GRUV2 = GRU - GRUCellV2 = GRUCell - LSTMV2 = LSTM - LSTMCellV2 = LSTMCell -else: - from keras.layers.rnn.gru import GRU as GRUV2 - from keras.layers.rnn.gru import GRUCell as GRUCellV2 - from keras.layers.rnn.gru_v1 import GRU - from keras.layers.rnn.gru_v1 import GRUCell - from keras.layers.rnn.lstm import LSTM as LSTMV2 - from keras.layers.rnn.lstm import LSTMCell as LSTMCellV2 - from keras.layers.rnn.lstm_v1 import LSTM - from keras.layers.rnn.lstm_v1 import LSTMCell - - GRUV1 = GRU - GRUCellV1 = GRUCell - LSTMV1 = LSTM - LSTMCellV1 = LSTMCell - -# Serialization functions. -from keras.layers import serialization - -# Wrapper functions. -from keras.layers.rnn.base_wrapper import Wrapper -from keras.layers.rnn.bidirectional import Bidirectional - -# RNN Cell wrappers. -from keras.layers.rnn.cell_wrappers import DeviceWrapper -from keras.layers.rnn.cell_wrappers import DropoutWrapper -from keras.layers.rnn.cell_wrappers import ResidualWrapper - -# Convolutional-recurrent layers. -from keras.layers.rnn.conv_lstm1d import ConvLSTM1D -from keras.layers.rnn.conv_lstm2d import ConvLSTM2D -from keras.layers.rnn.conv_lstm3d import ConvLSTM3D -from keras.layers.rnn.cudnn_gru import CuDNNGRU - -# cuDNN recurrent layers. -from keras.layers.rnn.cudnn_lstm import CuDNNLSTM -from keras.layers.rnn.time_distributed import TimeDistributed -from keras.layers.serialization import deserialize -from keras.layers.serialization import deserialize_from_json -from keras.layers.serialization import get_builtin_layer -from keras.layers.serialization import serialize - - -class VersionAwareLayers: - """Utility to be used internally to access layers in a V1/V2-aware fashion. - - When using layers within the Keras codebase, under the constraint that - e.g. `layers.BatchNormalization` should be the `BatchNormalization` version - corresponding to the current runtime (TF1 or TF2), do not simply access - `layers.BatchNormalization` since it would ignore e.g. an early - `compat.v2.disable_v2_behavior()` call. Instead, use an instance - of `VersionAwareLayers` (which you can use just like the `layers` module). - """ - - def __getattr__(self, name): - serialization.populate_deserializable_objects() - if name in serialization.LOCAL.ALL_OBJECTS: - return serialization.LOCAL.ALL_OBJECTS[name] - return super().__getattr__(name) diff --git a/keras/layers/convolutional/BUILD b/keras/layers/convolutional/BUILD deleted file mode 100644 index 60560697c..000000000 --- a/keras/layers/convolutional/BUILD +++ /dev/null @@ -1,308 +0,0 @@ -# Description: -# Contains the Keras convolution layers. - -# Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "cuda_py_test") - -package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], - default_visibility = [ - "//keras:__subpackages__", - "//third_party/tensorflow/python/distribute:__pkg__", - "//third_party/tensorflow/python/feature_column:__pkg__", - "//third_party/tensorflow/python/keras:__subpackages__", - "//third_party/tensorflow/python/trackable:__pkg__", - "//third_party/tensorflow/tools/pip_package:__pkg__", - "//third_party/tensorflow_models/official/projects/residual_mobilenet/modeling/backbones:__pkg__", - ], - licenses = ["notice"], -) - -py_library( - name = "convolutional", - srcs = [ - "__init__.py", - ], - srcs_version = "PY3", - deps = [ - ":conv1d", - ":conv1d_transpose", - ":conv2d", - ":conv2d_transpose", - ":conv3d", - ":conv3d_transpose", - ":depthwise_conv1d", - ":depthwise_conv2d", - ":separable_conv1d", - ":separable_conv2d", - "//keras/layers/pooling:average_pooling1d", - "//keras/layers/pooling:average_pooling2d", - "//keras/layers/pooling:average_pooling3d", - "//keras/layers/pooling:max_pooling1d", - "//keras/layers/pooling:max_pooling2d", - "//keras/layers/pooling:max_pooling3d", - "//keras/layers/reshaping:cropping1d", - "//keras/layers/reshaping:cropping2d", - "//keras/layers/reshaping:cropping3d", - "//keras/layers/reshaping:up_sampling1d", - "//keras/layers/reshaping:up_sampling2d", - "//keras/layers/reshaping:up_sampling3d", - "//keras/layers/reshaping:zero_padding1d", - "//keras/layers/reshaping:zero_padding2d", - "//keras/layers/reshaping:zero_padding3d", - ], -) - -py_library( - name = "base_conv", - srcs = ["base_conv.py"], - srcs_version = "PY3", - deps = [ - "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/initializers", - "//keras/utils:engine_utils", - ], -) - -py_library( - name = "conv1d", - srcs = ["conv1d.py"], - srcs_version = "PY3", - deps = [ - ":base_conv", - "//keras:activations", - "//keras:constraints", - "//keras:regularizers", - "//keras/dtensor:utils", - "//keras/initializers", - ], -) - -py_library( - name = "conv2d", - srcs = ["conv2d.py"], - srcs_version = "PY3", - deps = [ - ":base_conv", - "//keras:activations", - "//keras:constraints", - "//keras:regularizers", - "//keras/dtensor:utils", - "//keras/initializers", - ], -) - -py_library( - name = "conv3d", - srcs = ["conv3d.py"], - srcs_version = "PY3", - deps = [ - ":base_conv", - "//keras:activations", - "//keras:constraints", - "//keras:regularizers", - "//keras/dtensor:utils", - "//keras/initializers", - ], -) - -py_library( - name = "conv1d_transpose", - srcs = ["conv1d_transpose.py"], - srcs_version = "PY3", - deps = [ - ":conv1d", - "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:constraints", - "//keras:regularizers", - "//keras/dtensor:utils", - "//keras/engine:input_spec", - "//keras/initializers", - "//keras/utils:engine_utils", - ], -) - -py_library( - name = "conv2d_transpose", - srcs = ["conv2d_transpose.py"], - srcs_version = "PY3", - deps = [ - ":conv2d", - "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:backend", - "//keras:constraints", - "//keras:regularizers", - "//keras/dtensor:utils", - "//keras/engine:input_spec", - "//keras/initializers", - "//keras/utils:engine_utils", - ], -) - -py_library( - name = "conv3d_transpose", - srcs = ["conv3d_transpose.py"], - srcs_version = "PY3", - deps = [ - ":conv3d", - "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:constraints", - "//keras:regularizers", - "//keras/dtensor:utils", - "//keras/engine:input_spec", - "//keras/initializers", - "//keras/utils:engine_utils", - ], -) - -py_library( - name = "base_separable_conv", - srcs = ["base_separable_conv.py"], - srcs_version = "PY3", - deps = [ - ":base_conv", - "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:input_spec", - "//keras/initializers", - ], -) - -py_library( - name = "separable_conv1d", - srcs = ["separable_conv1d.py"], - srcs_version = "PY3", - deps = [ - ":base_separable_conv", - "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:constraints", - "//keras:regularizers", - "//keras/initializers", - "//keras/utils:engine_utils", - ], -) - -py_library( - name = "separable_conv2d", - srcs = ["separable_conv2d.py"], - srcs_version = "PY3", - deps = [ - ":base_separable_conv", - "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:constraints", - "//keras:regularizers", - "//keras/initializers", - "//keras/utils:engine_utils", - ], -) - -py_library( - name = "base_depthwise_conv", - srcs = ["base_depthwise_conv.py"], - srcs_version = "PY3", - deps = [ - ":base_conv", - "//:expect_tensorflow_installed", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:input_spec", - "//keras/initializers", - ], -) - -py_library( - name = "depthwise_conv1d", - srcs = ["depthwise_conv1d.py"], - srcs_version = "PY3", - deps = [ - ":base_depthwise_conv", - "//:expect_tensorflow_installed", - "//keras/utils:engine_utils", - "//keras/utils:tf_utils", - ], -) - -py_library( - name = "depthwise_conv2d", - srcs = ["depthwise_conv2d.py"], - srcs_version = "PY3", - deps = [ - ":base_depthwise_conv", - "//keras:backend", - "//keras/utils:engine_utils", - "//keras/utils:tf_utils", - ], -) - -cuda_py_test( - name = "conv_test", - size = "medium", - srcs = ["conv_test.py"], - python_version = "PY3", - shard_count = 8, - deps = [ - "//:expect_absl_installed", - "//:expect_numpy_installed", - "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - ], -) - -cuda_py_test( - name = "conv_transpose_test", - size = "medium", - srcs = ["conv_transpose_test.py"], - python_version = "PY3", - deps = [ - "//:expect_absl_installed", - "//:expect_numpy_installed", - "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - ], -) - -cuda_py_test( - name = "depthwise_conv_test", - size = "medium", - srcs = ["depthwise_conv_test.py"], - python_version = "PY3", - shard_count = 8, - deps = [ - "//:expect_absl_installed", - "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - ], -) - -cuda_py_test( - name = "separable_conv_test", - size = "medium", - srcs = ["separable_conv_test.py"], - python_version = "PY3", - deps = [ - "//:expect_absl_installed", - "//:expect_numpy_installed", - "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - ], -) diff --git a/keras/layers/convolutional/__init__.py b/keras/layers/convolutional/__init__.py deleted file mode 100644 index 6b3d3d14c..000000000 --- a/keras/layers/convolutional/__init__.py +++ /dev/null @@ -1,56 +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. -# ============================================================================== -"""Keras convolution layers.""" - - -# Convolution layer aliases. -# Convolution layers. -from keras.layers.convolutional.conv1d import Conv1D -from keras.layers.convolutional.conv1d import Convolution1D -from keras.layers.convolutional.conv1d_transpose import Conv1DTranspose -from keras.layers.convolutional.conv1d_transpose import Convolution1DTranspose -from keras.layers.convolutional.conv2d import Conv2D -from keras.layers.convolutional.conv2d import Convolution2D -from keras.layers.convolutional.conv2d_transpose import Conv2DTranspose -from keras.layers.convolutional.conv2d_transpose import Convolution2DTranspose -from keras.layers.convolutional.conv3d import Conv3D -from keras.layers.convolutional.conv3d import Convolution3D -from keras.layers.convolutional.conv3d_transpose import Conv3DTranspose -from keras.layers.convolutional.conv3d_transpose import Convolution3DTranspose -from keras.layers.convolutional.depthwise_conv1d import DepthwiseConv1D -from keras.layers.convolutional.depthwise_conv2d import DepthwiseConv2D -from keras.layers.convolutional.separable_conv1d import SeparableConv1D -from keras.layers.convolutional.separable_conv1d import SeparableConvolution1D -from keras.layers.convolutional.separable_conv2d import SeparableConv2D -from keras.layers.convolutional.separable_conv2d import SeparableConvolution2D - -# Pooling layers imported for backwards namespace compatibility. -from keras.layers.pooling.average_pooling1d import AveragePooling1D -from keras.layers.pooling.average_pooling2d import AveragePooling2D -from keras.layers.pooling.average_pooling3d import AveragePooling3D -from keras.layers.pooling.max_pooling1d import MaxPooling1D -from keras.layers.pooling.max_pooling2d import MaxPooling2D -from keras.layers.pooling.max_pooling3d import MaxPooling3D - -# Reshaping layers imported for backwards namespace compatibility -from keras.layers.reshaping.cropping1d import Cropping1D -from keras.layers.reshaping.cropping2d import Cropping2D -from keras.layers.reshaping.cropping3d import Cropping3D -from keras.layers.reshaping.up_sampling1d import UpSampling1D -from keras.layers.reshaping.up_sampling2d import UpSampling2D -from keras.layers.reshaping.up_sampling3d import UpSampling3D -from keras.layers.reshaping.zero_padding1d import ZeroPadding1D -from keras.layers.reshaping.zero_padding2d import ZeroPadding2D -from keras.layers.reshaping.zero_padding3d import ZeroPadding3D diff --git a/keras/layers/core/__init__.py b/keras/layers/core/__init__.py deleted file mode 100644 index 21d3c6ab5..000000000 --- a/keras/layers/core/__init__.py +++ /dev/null @@ -1,47 +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. -# ============================================================================== -"""Core Keras layers.""" - -from keras.layers.core.activation import Activation -from keras.layers.core.dense import Dense -from keras.layers.core.einsum_dense import EinsumDense -from keras.layers.core.embedding import Embedding -from keras.layers.core.identity import Identity -from keras.layers.core.lambda_layer import Lambda -from keras.layers.core.masking import Masking - -# Required by third_party/py/tensorflow_gnn/keras/keras_tensors.py -from keras.layers.core.tf_op_layer import ClassMethod -from keras.layers.core.tf_op_layer import InstanceMethod -from keras.layers.core.tf_op_layer import InstanceProperty -from keras.layers.core.tf_op_layer import SlicingOpLambda -from keras.layers.core.tf_op_layer import TFOpLambda -from keras.layers.core.tf_op_layer import _delegate_method -from keras.layers.core.tf_op_layer import _delegate_property - -# Regularization layers imported for backwards namespace compatibility -from keras.layers.regularization.activity_regularization import ( - ActivityRegularization, -) -from keras.layers.regularization.dropout import Dropout -from keras.layers.regularization.spatial_dropout1d import SpatialDropout1D -from keras.layers.regularization.spatial_dropout2d import SpatialDropout2D -from keras.layers.regularization.spatial_dropout3d import SpatialDropout3D - -# Reshaping layers imported for backwards namespace compatibility -from keras.layers.reshaping.flatten import Flatten -from keras.layers.reshaping.permute import Permute -from keras.layers.reshaping.repeat_vector import RepeatVector -from keras.layers.reshaping.reshape import Reshape diff --git a/keras/layers/merging/__init__.py b/keras/layers/merging/__init__.py deleted file mode 100644 index beb834f31..000000000 --- a/keras/layers/merging/__init__.py +++ /dev/null @@ -1,35 +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. -# ============================================================================== -"""Keras merging layers.""" - - -# Merging functions. -# Merging layers. -from keras.layers.merging.add import Add -from keras.layers.merging.add import add -from keras.layers.merging.average import Average -from keras.layers.merging.average import average -from keras.layers.merging.concatenate import Concatenate -from keras.layers.merging.concatenate import concatenate -from keras.layers.merging.dot import Dot -from keras.layers.merging.dot import dot -from keras.layers.merging.maximum import Maximum -from keras.layers.merging.maximum import maximum -from keras.layers.merging.minimum import Minimum -from keras.layers.merging.minimum import minimum -from keras.layers.merging.multiply import Multiply -from keras.layers.merging.multiply import multiply -from keras.layers.merging.subtract import Subtract -from keras.layers.merging.subtract import subtract diff --git a/keras/layers/pooling/__init__.py b/keras/layers/pooling/__init__.py deleted file mode 100644 index d70383f39..000000000 --- a/keras/layers/pooling/__init__.py +++ /dev/null @@ -1,43 +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. -# ============================================================================== -"""Keras Pooling layers.""" - - -# Pooling layer aliases. -# Pooling layers. -from keras.layers.pooling.average_pooling1d import AveragePooling1D -from keras.layers.pooling.average_pooling1d import AvgPool1D -from keras.layers.pooling.average_pooling2d import AveragePooling2D -from keras.layers.pooling.average_pooling2d import AvgPool2D -from keras.layers.pooling.average_pooling3d import AveragePooling3D -from keras.layers.pooling.average_pooling3d import AvgPool3D -from keras.layers.pooling.global_average_pooling1d import GlobalAveragePooling1D -from keras.layers.pooling.global_average_pooling1d import GlobalAvgPool1D -from keras.layers.pooling.global_average_pooling2d import GlobalAveragePooling2D -from keras.layers.pooling.global_average_pooling2d import GlobalAvgPool2D -from keras.layers.pooling.global_average_pooling3d import GlobalAveragePooling3D -from keras.layers.pooling.global_average_pooling3d import GlobalAvgPool3D -from keras.layers.pooling.global_max_pooling1d import GlobalMaxPool1D -from keras.layers.pooling.global_max_pooling1d import GlobalMaxPooling1D -from keras.layers.pooling.global_max_pooling2d import GlobalMaxPool2D -from keras.layers.pooling.global_max_pooling2d import GlobalMaxPooling2D -from keras.layers.pooling.global_max_pooling3d import GlobalMaxPool3D -from keras.layers.pooling.global_max_pooling3d import GlobalMaxPooling3D -from keras.layers.pooling.max_pooling1d import MaxPool1D -from keras.layers.pooling.max_pooling1d import MaxPooling1D -from keras.layers.pooling.max_pooling2d import MaxPool2D -from keras.layers.pooling.max_pooling2d import MaxPooling2D -from keras.layers.pooling.max_pooling3d import MaxPool3D -from keras.layers.pooling.max_pooling3d import MaxPooling3D diff --git a/keras/layers/reshaping/__init__.py b/keras/layers/reshaping/__init__.py deleted file mode 100644 index fcf860c52..000000000 --- a/keras/layers/reshaping/__init__.py +++ /dev/null @@ -1,29 +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. -# ============================================================================== -"""Keras reshaping layers layers.""" - -from keras.layers.reshaping.cropping1d import Cropping1D -from keras.layers.reshaping.cropping2d import Cropping2D -from keras.layers.reshaping.cropping3d import Cropping3D -from keras.layers.reshaping.flatten import Flatten -from keras.layers.reshaping.permute import Permute -from keras.layers.reshaping.repeat_vector import RepeatVector -from keras.layers.reshaping.reshape import Reshape -from keras.layers.reshaping.up_sampling1d import UpSampling1D -from keras.layers.reshaping.up_sampling2d import UpSampling2D -from keras.layers.reshaping.up_sampling3d import UpSampling3D -from keras.layers.reshaping.zero_padding1d import ZeroPadding1D -from keras.layers.reshaping.zero_padding2d import ZeroPadding2D -from keras.layers.reshaping.zero_padding3d import ZeroPadding3D diff --git a/keras/layers/rnn/__init__.py b/keras/layers/rnn/__init__.py deleted file mode 100644 index a2438fc7d..000000000 --- a/keras/layers/rnn/__init__.py +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 2016 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. -# ============================================================================== -"""Keras recurrent layers.""" - -import tensorflow.compat.v2 as tf - -from keras.layers.rnn.abstract_rnn_cell import AbstractRNNCell - -# Recurrent layers. -from keras.layers.rnn.base_rnn import RNN -from keras.layers.rnn.simple_rnn import SimpleRNN -from keras.layers.rnn.simple_rnn import SimpleRNNCell -from keras.layers.rnn.stacked_rnn_cells import StackedRNNCells - -if tf.__internal__.tf2.enabled(): - from keras.layers.rnn.gru import GRU - from keras.layers.rnn.gru import GRUCell - from keras.layers.rnn.gru_v1 import GRU as GRUV1 - from keras.layers.rnn.gru_v1 import GRUCell as GRUCellV1 - from keras.layers.rnn.lstm import LSTM - from keras.layers.rnn.lstm import LSTMCell - from keras.layers.rnn.lstm_v1 import LSTM as LSTMV1 - from keras.layers.rnn.lstm_v1 import LSTMCell as LSTMCellV1 - - GRUV2 = GRU - GRUCellV2 = GRUCell - LSTMV2 = LSTM - LSTMCellV2 = LSTMCell -else: - from keras.layers.rnn.gru import GRU as GRUV2 - from keras.layers.rnn.gru import GRUCell as GRUCellV2 - from keras.layers.rnn.gru_v1 import GRU - from keras.layers.rnn.gru_v1 import GRUCell - from keras.layers.rnn.lstm import LSTM as LSTMV2 - from keras.layers.rnn.lstm import LSTMCell as LSTMCellV2 - from keras.layers.rnn.lstm_v1 import LSTM - from keras.layers.rnn.lstm_v1 import LSTMCell - - GRUV1 = GRU - GRUCellV1 = GRUCell - LSTMV1 = LSTM - LSTMCellV1 = LSTMCell - -# Wrapper functions. -from keras.layers.rnn.base_wrapper import Wrapper -from keras.layers.rnn.bidirectional import Bidirectional - -# RNN Cell wrappers. -from keras.layers.rnn.cell_wrappers import DeviceWrapper -from keras.layers.rnn.cell_wrappers import DropoutWrapper -from keras.layers.rnn.cell_wrappers import ResidualWrapper - -# Convolutional-recurrent layers. -from keras.layers.rnn.conv_lstm1d import ConvLSTM1D -from keras.layers.rnn.conv_lstm2d import ConvLSTM2D -from keras.layers.rnn.conv_lstm3d import ConvLSTM3D -from keras.layers.rnn.cudnn_gru import CuDNNGRU - -# cuDNN recurrent layers. -from keras.layers.rnn.cudnn_lstm import CuDNNLSTM -from keras.layers.rnn.time_distributed import TimeDistributed diff --git a/keras/legacy_tf_layers/__init__.py b/keras/legacy_tf_layers/__init__.py deleted file mode 100644 index 0bb028307..000000000 --- a/keras/legacy_tf_layers/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Init file.""" - -from keras.legacy_tf_layers import migration_utils diff --git a/keras/metrics/__init__.py b/keras/metrics/__init__.py deleted file mode 100644 index 9cc4c770a..000000000 --- a/keras/metrics/__init__.py +++ /dev/null @@ -1,224 +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. -# ============================================================================== -"""All Keras metrics.""" - -# isort: off -import warnings -from tensorflow.python.util.tf_export import keras_export - -# Base classes and utilities -from keras.metrics.base_metric import Mean -from keras.metrics.base_metric import MeanMetricWrapper -from keras.metrics.base_metric import MeanTensor -from keras.metrics.base_metric import Metric -from keras.metrics.base_metric import Reduce -from keras.metrics.base_metric import Sum -from keras.metrics.base_metric import SumOverBatchSize -from keras.metrics.base_metric import SumOverBatchSizeMetricWrapper -from keras.metrics.base_metric import clone_metric -from keras.metrics.base_metric import clone_metrics - -from keras.saving.legacy import serialization as legacy_serialization -from keras.saving.serialization_lib import deserialize_keras_object -from keras.saving.serialization_lib import serialize_keras_object - -from keras.metrics.py_metric import PyMetric - -# Individual metric classes - -# Accuracy metrics -from keras.metrics.accuracy_metrics import Accuracy -from keras.metrics.accuracy_metrics import BinaryAccuracy -from keras.metrics.accuracy_metrics import CategoricalAccuracy -from keras.metrics.accuracy_metrics import SparseCategoricalAccuracy -from keras.metrics.accuracy_metrics import SparseTopKCategoricalAccuracy -from keras.metrics.accuracy_metrics import TopKCategoricalAccuracy - -from keras.metrics.accuracy_metrics import accuracy -from keras.metrics.accuracy_metrics import binary_accuracy -from keras.metrics.accuracy_metrics import categorical_accuracy -from keras.metrics.accuracy_metrics import sparse_categorical_accuracy -from keras.metrics.accuracy_metrics import sparse_top_k_categorical_accuracy -from keras.metrics.accuracy_metrics import top_k_categorical_accuracy - -# Probabilistic metrics -from keras.metrics.probabilistic_metrics import BinaryCrossentropy -from keras.metrics.probabilistic_metrics import CategoricalCrossentropy -from keras.metrics.probabilistic_metrics import KLDivergence -from keras.metrics.probabilistic_metrics import Poisson -from keras.metrics.probabilistic_metrics import SparseCategoricalCrossentropy - -from keras.metrics.probabilistic_metrics import binary_crossentropy -from keras.metrics.probabilistic_metrics import categorical_crossentropy -from keras.metrics.probabilistic_metrics import poisson -from keras.metrics.probabilistic_metrics import kullback_leibler_divergence -from keras.metrics.probabilistic_metrics import sparse_categorical_crossentropy - -# Regression metrics -from keras.metrics.regression_metrics import CosineSimilarity -from keras.metrics.regression_metrics import LogCoshError -from keras.metrics.regression_metrics import MeanAbsoluteError -from keras.metrics.regression_metrics import MeanAbsolutePercentageError -from keras.metrics.regression_metrics import MeanRelativeError -from keras.metrics.regression_metrics import MeanSquaredError -from keras.metrics.regression_metrics import MeanSquaredLogarithmicError -from keras.metrics.regression_metrics import RootMeanSquaredError -from keras.metrics.regression_metrics import R2Score - -from keras.metrics.regression_metrics import cosine_similarity -from keras.metrics.regression_metrics import logcosh -from keras.metrics.regression_metrics import mean_absolute_error -from keras.metrics.regression_metrics import mean_absolute_percentage_error -from keras.metrics.regression_metrics import mean_squared_error -from keras.metrics.regression_metrics import mean_squared_logarithmic_error - -# Confusion metrics -from keras.metrics.confusion_metrics import AUC -from keras.metrics.confusion_metrics import FalseNegatives -from keras.metrics.confusion_metrics import FalsePositives -from keras.metrics.confusion_metrics import Precision -from keras.metrics.confusion_metrics import PrecisionAtRecall -from keras.metrics.confusion_metrics import Recall -from keras.metrics.confusion_metrics import RecallAtPrecision -from keras.metrics.confusion_metrics import SensitivityAtSpecificity -from keras.metrics.confusion_metrics import SensitivitySpecificityBase -from keras.metrics.confusion_metrics import SpecificityAtSensitivity -from keras.metrics.confusion_metrics import TrueNegatives -from keras.metrics.confusion_metrics import TruePositives - -# F-Scores -from keras.metrics.f_score_metrics import FBetaScore -from keras.metrics.f_score_metrics import F1Score - -# IoU metrics -from keras.metrics.iou_metrics import BinaryIoU -from keras.metrics.iou_metrics import IoU -from keras.metrics.iou_metrics import MeanIoU -from keras.metrics.iou_metrics import OneHotIoU -from keras.metrics.iou_metrics import OneHotMeanIoU - -# Hinge metrics -from keras.metrics.hinge_metrics import CategoricalHinge -from keras.metrics.hinge_metrics import Hinge -from keras.metrics.hinge_metrics import SquaredHinge - -from keras.metrics.hinge_metrics import categorical_hinge -from keras.metrics.hinge_metrics import squared_hinge -from keras.metrics.hinge_metrics import hinge - -# Aliases -acc = ACC = accuracy -bce = BCE = binary_crossentropy -mse = MSE = mean_squared_error -mae = MAE = mean_absolute_error -mape = MAPE = mean_absolute_percentage_error -msle = MSLE = mean_squared_logarithmic_error -log_cosh = logcosh -cosine_proximity = cosine_similarity - - -@keras_export("keras.metrics.serialize") -def serialize(metric, use_legacy_format=False): - """Serializes metric function or `Metric` instance. - - Args: - metric: A Keras `Metric` instance or a metric function. - - Returns: - Metric configuration dictionary. - """ - if metric is None: - return None - if not isinstance(metric, Metric): - warnings.warn( - "The `keras.metrics.serialize()` API should only be used for " - "objects of type `keras.metrics.Metric`. Found an instance of " - f"type {type(metric)}, which may lead to improper serialization." - ) - if use_legacy_format: - return legacy_serialization.serialize_keras_object(metric) - return serialize_keras_object(metric) - - -@keras_export("keras.metrics.deserialize") -def deserialize(config, custom_objects=None, use_legacy_format=False): - """Deserializes a serialized metric class/function instance. - - Args: - config: Metric configuration. - custom_objects: Optional dictionary mapping names (strings) to custom - objects (classes and functions) to be considered during deserialization. - - Returns: - A Keras `Metric` instance or a metric function. - """ - if use_legacy_format: - return legacy_serialization.deserialize_keras_object( - config, - module_objects=globals(), - custom_objects=custom_objects, - printable_module_name="metric function", - ) - return deserialize_keras_object( - config, - module_objects=globals(), - custom_objects=custom_objects, - printable_module_name="metric function", - ) - - -@keras_export("keras.metrics.get") -def get(identifier): - """Retrieves a Keras metric as a `function`/`Metric` class instance. - - The `identifier` may be the string name of a metric function or class. - - >>> metric = tf.keras.metrics.get("categorical_crossentropy") - >>> type(metric) - - >>> metric = tf.keras.metrics.get("CategoricalCrossentropy") - >>> type(metric) - - - You can also specify `config` of the metric to this function by passing dict - containing `class_name` and `config` as an identifier. Also note that the - `class_name` must map to a `Metric` class - - >>> identifier = {"class_name": "CategoricalCrossentropy", - ... "config": {"from_logits": True}} - >>> metric = tf.keras.metrics.get(identifier) - >>> type(metric) - - - Args: - identifier: A metric identifier. One of None or string name of a metric - function/class or metric configuration dictionary or a metric function - or a metric class instance - - Returns: - A Keras metric as a `function`/ `Metric` class instance. - - Raises: - ValueError: If `identifier` cannot be interpreted. - """ - if isinstance(identifier, dict): - use_legacy_format = "module" not in identifier - return deserialize(identifier, use_legacy_format=use_legacy_format) - elif isinstance(identifier, str): - return deserialize(str(identifier)) - elif callable(identifier): - return identifier - else: - raise ValueError(f"Could not interpret metric identifier: {identifier}") diff --git a/keras/models/__init__.py b/keras/models/__init__.py deleted file mode 100644 index 6737076ba..000000000 --- a/keras/models/__init__.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2022 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. -# ============================================================================== -"""Keras models API.""" - - -from keras.engine.functional import Functional -from keras.engine.sequential import Sequential -from keras.engine.training import Model - -# Private symbols that are used in tests. -# TODO(b/221261361): Clean up private symbols usage and remove these imports. -from keras.models.cloning import _clone_functional_model -from keras.models.cloning import _clone_layer -from keras.models.cloning import _clone_layers_and_model_config -from keras.models.cloning import _clone_sequential_model -from keras.models.cloning import clone_and_build_model -from keras.models.cloning import clone_model -from keras.models.cloning import share_weights -from keras.models.sharpness_aware_minimization import SharpnessAwareMinimization -from keras.saving.legacy.model_config import model_from_config -from keras.saving.legacy.model_config import model_from_json -from keras.saving.legacy.model_config import model_from_yaml -from keras.saving.saving_api import load_model -from keras.saving.saving_api import save_model diff --git a/keras/opensource_only.files b/keras/opensource_only.files deleted file mode 100644 index e237c53b8..000000000 --- a/keras/opensource_only.files +++ /dev/null @@ -1,3 +0,0 @@ -keras/api/tests/API_UPDATE_WARNING.txt: -keras/api/tests/README.txt: -keras/benchmarks/layer_benchmarks/run_xprof.py: diff --git a/keras/optimizers/schedules/BUILD b/keras/optimizers/schedules/BUILD deleted file mode 100644 index f217a64ad..000000000 --- a/keras/optimizers/schedules/BUILD +++ /dev/null @@ -1,38 +0,0 @@ -# Description: -# Contains the learning rate schedule API, - -# Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "cuda_py_test") - -package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], - default_visibility = ["//keras:friends"], - licenses = ["notice"], -) - -py_library( - name = "learning_rate_schedule", - srcs = [ - "learning_rate_schedule.py", - ], - srcs_version = "PY3", - deps = [ - "//:expect_tensorflow_installed", - "//keras/utils:generic_utils", - ], -) - -cuda_py_test( - name = "learning_rate_schedule_test", - size = "medium", - srcs = ["learning_rate_schedule_test.py"], - shard_count = 4, - deps = [ - "//:expect_absl_installed", - "//:expect_numpy_installed", - "//:expect_tensorflow_installed", - "//keras", - "//keras/optimizers/legacy:optimizers", - "//keras/testing_infra:test_combinations", - ], -) diff --git a/keras/tools/pip_package/BUILD b/keras/tools/pip_package/BUILD deleted file mode 100644 index 5b086a4f0..000000000 --- a/keras/tools/pip_package/BUILD +++ /dev/null @@ -1,44 +0,0 @@ -package(default_visibility = ["//keras:__subpackages__"]) - -# Description: -# Tools for building the TensorFlow pip package. - -COMMON_PIP_DEPS = [ - "//keras/api:keras_api", - # The following targets are not included by //keras:keras, - # eg to avoid circular dependency with TF, but they should still be included - # in the PIP package. - "//keras/legacy_tf_layers:convolutional", - "//keras/legacy_tf_layers:core", - "//keras/legacy_tf_layers:layers_base", - "//keras/legacy_tf_layers:normalization", - "//keras/legacy_tf_layers:pooling", - "//keras/layers/rnn:legacy_cell_wrappers", - "//keras/layers/rnn:legacy_cells", - "//keras/optimizers:legacy_learning_rate_decay", - # Need to include testing libraries in pip package so our pip - # release tests can run. (see py_test rule in keras.bzl for more context). - # Essentially, everything needed to run the test (except the test file itself) - # must be contained in the pip package since we strip away all deps. - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/benchmarks:keras_benchmark_lib_pip", - "//keras/dtensor:integration_test_utils", - "//keras/dtensor:test_util", - "//keras/distribute:distribute_test_lib_pip", - "//keras/integration_test:preprocessing_test_utils", - "//keras/integration_test/models:models", - "//keras/layers/preprocessing:preprocessing_test_utils", - "//keras/layers/preprocessing/benchmarks:feature_column_benchmark", - "//keras/mixed_precision:test_util", - "//keras/tests:model_architectures", - "//keras/tests:model_subclassing_test_util", - "//keras/utils:dataset_creator", - "//keras/utils:kpl_test_utils", -] - -sh_binary( - name = "build_pip_package", - srcs = ["build_pip_package.sh"], - data = COMMON_PIP_DEPS, -) diff --git a/keras/utils/__init__.py b/keras/utils/__init__.py deleted file mode 100644 index db2063432..000000000 --- a/keras/utils/__init__.py +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 2022 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. -# ============================================================================== -"""Public Keras utilities.""" - -# isort: off - -# Serialization related -from keras.saving.serialization_lib import deserialize_keras_object -from keras.saving.serialization_lib import serialize_keras_object -from keras.saving.object_registration import CustomObjectScope -from keras.saving.object_registration import custom_object_scope -from keras.saving.object_registration import get_custom_objects -from keras.saving.object_registration import get_registered_name -from keras.saving.object_registration import register_keras_serializable - -# Dataset related -from keras.utils.audio_dataset import audio_dataset_from_directory -from keras.utils.text_dataset import text_dataset_from_directory -from keras.utils.timeseries_dataset import timeseries_dataset_from_array -from keras.utils.image_dataset import image_dataset_from_directory -from keras.utils.dataset_utils import split_dataset - -# Sequence related -from keras.utils.data_utils import GeneratorEnqueuer -from keras.utils.data_utils import OrderedEnqueuer -from keras.utils.data_utils import Sequence -from keras.utils.data_utils import SequenceEnqueuer - -# Image related -from keras.utils.image_utils import array_to_img -from keras.utils.image_utils import img_to_array -from keras.utils.image_utils import load_img -from keras.utils.image_utils import save_img - -# Python utils -from keras.utils.tf_utils import set_random_seed -from keras.utils.generic_utils import Progbar -from keras.utils.data_utils import get_file - -# Preprocessing utils -from keras.utils.feature_space import FeatureSpace - -# Internal -from keras.utils.layer_utils import get_source_inputs -from keras.utils.layer_utils import warmstart_embedding_matrix - -# Deprecated -from keras.utils.np_utils import normalize -from keras.utils.np_utils import to_categorical -from keras.utils.np_utils import to_ordinal -from keras.utils.data_utils import pad_sequences - -# Evaluation related -from keras.utils.sidecar_evaluator import SidecarEvaluator -from keras.utils.sidecar_evaluator import SidecarEvaluatorModelExport - -# Timed Thread -from keras.utils.timed_threads import TimedThread - -# Visualization related -from keras.utils.vis_utils import model_to_dot -from keras.utils.vis_utils import plot_model diff --git a/oss_setup.py b/oss_setup.py index 07db3105c..3b38ae7e3 100644 --- a/oss_setup.py +++ b/oss_setup.py @@ -12,34 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Setup script for the Keras pip package.""" +"""Setup script for the TF-Keras pip package.""" import os import setuptools -DESCRIPTION = """Keras is a deep learning API written in Python, +DESCRIPTION = """TF-Keras is a deep learning API written in Python, running on top of the machine learning platform TensorFlow. It was developed with a focus on enabling fast experimentation and providing a delightful developer experience. -The purpose of Keras is to give an *unfair advantage* to any developer +The purpose of TF-Keras is to give an *unfair advantage* to any developer looking to ship ML-powered apps. - -Keras is: - -- **Simple** -- but not simplistic. Keras reduces developer *cognitive load* - to free you to focus on the parts of the problem that really matter. - Keras focuses on ease of use, debugging speed, code elegance & conciseness, - maintainability, and deployability (via TFServing, TFLite, TF.js). -- **Flexible** -- Keras adopts the principle of *progressive disclosure of - complexity*: simple workflows should be quick and easy, while arbitrarily - advanced workflows should be *possible* via a clear path that builds upon - what you've already learned. -- **Powerful** -- Keras provides industry-strength performance and - scalability: it is used by organizations and companies including NASA, - YouTube, and Waymo. That's right -- your YouTube recommendations are - powered by Keras, and so is the world's most advanced driverless vehicle. """ with open(os.path.abspath(__file__)) as f: @@ -60,7 +45,7 @@ description="Deep learning for humans.", long_description=DESCRIPTION, url="https://keras.io/", - download_url="https://github.com/keras-team/keras/tags", + download_url="https://github.com/keras-team/tf-keras/tags", author="Keras team", author_email="keras-users@googlegroups.com", packages=setuptools.find_packages(), diff --git a/pip_build.py b/pip_build.py index 6c09c1ccb..505ff7523 100644 --- a/pip_build.py +++ b/pip_build.py @@ -1,20 +1,20 @@ -"""Build the Keras pip package. +"""Build the TF-Keras pip package. The steps are as follows: -0. Run bazel build in the Keras root directory to obtain protobuf Python files. +0. Run bazel build in the TF-Keras root directory to obtain protobuf Python files. 1. Create a temporary build directory (e.g. `/tmp/keras_build`) -2. Copy the Keras codebase to it (to `/tmp/keras_build/keras/src`) +2. Copy the TF-Keras codebase to it (to `/tmp/keras_build/tf_keras/src`) and rewrite internal imports so that they refer to `keras.src` rather than just `keras`. 3. Also copy `setup.py` to the build directory. -4. List and import every file in the codebase (in `/tmp/keras_build/keras/src`), +4. List and import every file in the codebase (in `/tmp/keras_build/tf_keras/src`), so we can inspect the symbols the codebase contains. 5. Use the annotations left by the `keras_export` decorator to filter the symbols that should be exported, as well as their export path (default one and v1 one). 6. Use this information to generate `__init__.py` files in - `tmp/keras_build/keras/`. + `tmp/keras_build/tf_keras/`. 7. Run the setup script to write out build artifacts to `tmp/keras_build/dist`. 8. Copy the artifacts out. This is what should be uploaded to PyPI. @@ -22,14 +22,14 @@ Notes: -* This script should be run on the Keras codebase as obtained from GitHub +* This script should be run on the TF-Keras codebase as obtained from GitHub (OSS-facing), not the Google-internal one. The files are expect to be already converted to their public form. * This script only targets Linux x86 64. It could be adapted to MacOS relatively easily by changing requirements.txt and the bazel build script. -* This script should be run from an environment that has all Keras dependencies +* This script should be run from an environment that has all TF-Keras dependencies installed. Note that their specific version is not important; the only - thing that matters is that we should be able to import the Keras codebase + thing that matters is that we should be able to import the TF-Keras codebase in its current state (so we can perform step 4). If you install the dependencies used by the latest TF-nightly you should be good. """ @@ -46,7 +46,7 @@ import sys import tempfile -PACKAGE_NAME = "keras" +PACKAGE_NAME = "tf_keras" DIST_DIRNAME = "dist" SRC_DIRNAME = "src" TMP_BUILD_DIRNAME = "keras_build" @@ -77,7 +77,7 @@ def ignore(path, names): def convert_keras_imports(src_directory): def _convert_line(line): - if "import keras.protobuf" in line or "from keras.protobuf" in line: + if "import tf_keras.protobuf" in line or "from tf_keras.protobuf" in line: return line # Imports starting from `root_name`. if line.strip() == f"import {PACKAGE_NAME}": @@ -100,7 +100,7 @@ def _convert_line(line): f"from {PACKAGE_NAME}.{SRC_DIRNAME} import", ) # A way to catch LazyLoader calls. Hacky. - line = line.replace('globals(), "keras.', 'globals(), "keras.src.') + line = line.replace('globals(), "tf_keras.', 'globals(), "tf_keras.src.') return line for root, _, files in os.walk(src_directory): @@ -136,7 +136,7 @@ def generate_keras_api_files(package_directory, src_directory): for root, _, files in os.walk(src_directory): for fname in files: parts = root.split("/") - parts = parts[parts.index("keras") :] + parts = parts[parts.index("tf_keras") :] base_entry_point = ".".join(parts) if fname == "__init__.py": codebase_walk_entry_points.append(base_entry_point) @@ -236,12 +236,12 @@ def has_same_metadata(a, b): write_out_api_files( init_files_content, target_dir=v2_path, - root_offset=["api", "_v2", "keras"], + root_offset=["api", "_v2", "tf_keras"], ) write_out_api_files( init_files_content_v1, target_dir=v1_path, - root_offset=["api", "_v1", "keras"], + root_offset=["api", "_v1", "tf_keras"], ) # Add missing __init__ files in api dirs. with open(os.path.join(package_directory, "api", "__init__.py"), "w"): @@ -340,14 +340,14 @@ def build_pip_package( is_nightly=False, rc=None, ): - # Build Keras with Bazel to get the protobuf .py files + # Build TF-Keras with Bazel to get the protobuf .py files os.chdir(keras_root_directory) os.system(f"sh {os.path.join('keras', 'tools', 'bazel_build.sh')}") os.chdir(build_directory) # Copy sources (`keras/` directory and setup files) to build directory copy_keras_codebase( - os.path.join(keras_root_directory, "keras"), src_directory + os.path.join(keras_root_directory, "tf_keras"), src_directory ) shutil.copy( os.path.join(keras_root_directory, "oss_setup.py"), @@ -362,7 +362,7 @@ def build_pip_package( # Move protobuf .py files to package root. shutil.rmtree(os.path.join(src_directory, "protobuf")) shutil.move( - os.path.join(keras_root_directory, "bazel-bin", "keras", "protobuf"), + os.path.join(keras_root_directory, "bazel-bin", "tf_keras", "protobuf"), package_directory, ) # Add blank __init__.py file in protobuf dir. diff --git a/requirements.txt b/requirements.txt index 412ef5fb6..28e51da8e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ pandas pydot scipy ~= 1.9.2 -# Remove once both TensorFlow and Keras nightly builds pass. +# Remove once both TensorFlow and TF-Keras nightly builds pass. # Temporarily enforce 3.20.3 version, as the only version which is compatible # with both new and old protobuf stubs. This is needed to resolve # Keras-TensorFlow circular dependency issue, when one of them gets a dependency diff --git a/keras/BUILD b/tf_keras/BUILD similarity index 68% rename from keras/BUILD rename to tf_keras/BUILD index d31fcbc2b..fd8d51bd8 100644 --- a/keras/BUILD +++ b/tf_keras/BUILD @@ -1,8 +1,8 @@ # Description: -# Contains the Keras API (internal TensorFlow version). +# Contains the TF-Keras API (internal TensorFlow version). # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") # copybara:uncomment_begin(google-only) # load("//tools/build_defs/license:license.bzl", "license") @@ -14,12 +14,12 @@ package( licenses = ["notice"], ) -# Keras code that doesn't live in core Keras directory, but still +# TF-Keras code that doesn't live in core TF-Keras directory, but still # need to directly access the keras code. # We shouldn't add any client side package to this list. package_group( name = "friends", - packages = ["//keras/..."], + packages = ["//tf_keras/..."], ) exports_files(["LICENSE"]) @@ -31,7 +31,7 @@ config_setting( ) py_library( - name = "keras", + name = "tf_keras", srcs = [ "__init__.py", ], @@ -45,24 +45,24 @@ py_library( "//:expect_scipy_installed", "//:expect_tensorflow_installed", "//:expect_yaml_installed", - "//keras/applications", - "//keras/datasets", - "//keras/distribute", - "//keras/estimator", - "//keras/feature_column", - "//keras/layers", - "//keras/layers/rnn:legacy_cell_wrappers", - "//keras/layers/rnn:legacy_cells", - "//keras/legacy_tf_layers:layers", - "//keras/mixed_precision:mixed_precision_experimental", - "//keras/models", - "//keras/optimizers", - "//keras/premade_models", - "//keras/preprocessing", - "//keras/saving", - "//keras/testing_infra:keras_doctest_lib", - "//keras/testing_infra:test_utils", # For keras.__internal__ API - "//keras/utils", + "//tf_keras/applications", + "//tf_keras/datasets", + "//tf_keras/distribute", + "//tf_keras/estimator", + "//tf_keras/feature_column", + "//tf_keras/layers", + "//tf_keras/layers/rnn:legacy_cell_wrappers", + "//tf_keras/layers/rnn:legacy_cells", + "//tf_keras/legacy_tf_layers:layers", + "//tf_keras/mixed_precision:mixed_precision_experimental", + "//tf_keras/models", + "//tf_keras/optimizers", + "//tf_keras/premade_models", + "//tf_keras/preprocessing", + "//tf_keras/saving", + "//tf_keras/testing_infra:keras_doctest_lib", + "//tf_keras/testing_infra:test_utils", # For keras.__internal__ API + "//tf_keras/utils", ], ) @@ -74,12 +74,12 @@ py_library( ":backend_config", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/distribute:distribute_coordinator_utils", - "//keras/engine:keras_tensor", - "//keras/utils:control_flow_util", - "//keras/utils:object_identity", - "//keras/utils:tf_contextlib", - "//keras/utils:tf_inspect", + "//tf_keras/distribute:distribute_coordinator_utils", + "//tf_keras/engine:keras_tensor", + "//tf_keras/utils:control_flow_util", + "//tf_keras/utils:object_identity", + "//tf_keras/utils:tf_contextlib", + "//tf_keras/utils:tf_inspect", ], ) @@ -96,12 +96,12 @@ py_library( py_library( name = "engine", srcs = [ - "//keras/metrics", - "//keras/models", + "//tf_keras/metrics", + "//tf_keras/models", ], srcs_version = "PY3", deps = [ - "//keras/engine", + "//tf_keras/engine", ], ) @@ -113,8 +113,8 @@ py_library( srcs_version = "PY3", deps = [ ":backend", - "//keras/layers/activation", - "//keras/utils:engine_utils", + "//tf_keras/layers/activation", + "//tf_keras/utils:engine_utils", ], ) @@ -124,7 +124,7 @@ py_library( srcs = [], srcs_version = "PY3", deps = [ - "//keras/engine:base_layer", + "//tf_keras/engine:base_layer", ], ) @@ -138,11 +138,11 @@ py_library( ":backend", "//:expect_tensorboard_installed", "//:expect_tensorflow_installed", - "//keras/distribute:distributed_file_utils", - "//keras/distribute:worker_training_state", - "//keras/protobuf:projector_config_proto_py_pb2", - "//keras/utils:engine_utils", - "//keras/utils:mode_keys", + "//tf_keras/distribute:distributed_file_utils", + "//tf_keras/distribute:worker_training_state", + "//tf_keras/protobuf:projector_config_proto_py_pb2", + "//tf_keras/utils:engine_utils", + "//tf_keras/utils:mode_keys", ], ) @@ -156,7 +156,7 @@ py_library( ":backend", "//:expect_tensorboard_installed", "//:expect_tensorflow_installed", - "//keras/utils:engine_utils", + "//tf_keras/utils:engine_utils", ], ) @@ -168,7 +168,7 @@ py_library( srcs_version = "PY3", deps = [ ":backend", - "//keras/utils:engine_utils", + "//tf_keras/utils:engine_utils", ], ) @@ -181,10 +181,10 @@ py_library( deps = [ ":backend", "//:expect_tensorflow_installed", - "//keras/saving:saving_lib", - "//keras/utils:engine_utils", - "//keras/utils:generic_utils", - "//keras/utils:tf_utils", + "//tf_keras/saving:saving_lib", + "//tf_keras/utils:engine_utils", + "//tf_keras/utils:generic_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -196,7 +196,7 @@ py_library( srcs_version = "PY3", deps = [ ":backend", - "//keras/utils:engine_utils", + "//tf_keras/utils:engine_utils", ], ) @@ -233,14 +233,14 @@ tf_py_test( deps = [ ":activations", ":backend", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_scipy_installed", "//:expect_tensorflow_installed", - "//keras/layers", - "//keras/layers/activation", - "//keras/layers/core", - "//keras/testing_infra:test_combinations", + "//tf_keras/layers", + "//tf_keras/layers/activation", + "//tf_keras/layers/core", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -254,7 +254,7 @@ tf_py_test( ":constraints", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -264,10 +264,10 @@ tf_py_test( srcs = ["regularizers_test.py"], python_version = "PY3", deps = [ - ":keras", - "//:expect_absl_installed", + ":tf_keras", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -285,8 +285,8 @@ tf_py_test( ":losses", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", - "//keras/utils:engine_utils", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/utils:engine_utils", ], ) @@ -302,11 +302,11 @@ tf_py_test( "notsan", ], deps = [ - ":keras", - "//:expect_absl_installed", + ":tf_keras", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -322,14 +322,14 @@ tf_py_test( deps = [ ":callbacks", ":callbacks_v1", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/engine", - "//keras/layers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:np_utils", + "//tf_keras/engine", + "//tf_keras/layers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:np_utils", ], ) @@ -342,11 +342,11 @@ tf_py_test( deps = [ ":backend", ":engine", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_scipy_installed", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -359,7 +359,7 @@ tf_py_test( ":backend", ":backend_config", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -382,13 +382,13 @@ tf_py_test( # deps = [ # ":distribute_utils", # "//:expect_tensorflow_installed", -# "//keras/distribute", # "//testing/pymocks:matchers", +# "//tf_keras/distribute", # ], # ) # # license( # name = "license", -# package_name = "keras", +# package_name = "tf_keras", # ) # copybara:uncomment_end diff --git a/keras/__init__.py b/tf_keras/__init__.py similarity index 78% rename from keras/__init__.py rename to tf_keras/__init__.py index f4a25e8f3..97257f529 100644 --- a/keras/__init__.py +++ b/tf_keras/__init__.py @@ -12,16 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Implementation of the Keras API, the high-level API of TensorFlow. +"""Implementation of the TF-Keras API, the high-level API of TensorFlow. Detailed documentation and user guides are available at [keras.io](https://keras.io). """ -from keras import distribute -from keras import models -from keras.engine.input_layer import Input -from keras.engine.sequential import Sequential -from keras.engine.training import Model +from tf_keras import distribute +from tf_keras import models +from tf_keras.engine.input_layer import Input +from tf_keras.engine.sequential import Sequential +from tf_keras.engine.training import Model # isort: off diff --git a/keras/activations.py b/tf_keras/activations.py similarity index 98% rename from keras/activations.py rename to tf_keras/activations.py index 776f8e032..cf1065c15 100644 --- a/keras/activations.py +++ b/tf_keras/activations.py @@ -19,13 +19,13 @@ import tensorflow.compat.v2 as tf -import keras.layers.activation as activation_layers -from keras import backend -from keras.saving import object_registration -from keras.saving import serialization_lib -from keras.saving.legacy import serialization as legacy_serialization -from keras.saving.legacy.saved_model import utils as saved_model_utils -from keras.utils import generic_utils +import tf_keras.layers.activation as activation_layers +from tf_keras import backend +from tf_keras.saving import object_registration +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy import serialization as legacy_serialization +from tf_keras.saving.legacy.saved_model import utils as saved_model_utils +from tf_keras.utils import generic_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -34,7 +34,7 @@ # In TF 2.x, if the `tf.nn.softmax` is used as an activation function in Keras # layers, it gets serialized as 'softmax_v2' instead of 'softmax' as the # internal method name is returned in serialization. This results in errors in -# model exporting and loading as Keras can't find any activation function with +# model exporting and loading as TF-Keras can't find any activation function with # the name of `softmax_v2`. # This dict maps the activation function name from its v2 version to its # canonical name. diff --git a/keras/activations_test.py b/tf_keras/activations_test.py similarity index 97% rename from keras/activations_test.py rename to tf_keras/activations_test.py index 2222d1574..8450011f1 100644 --- a/keras/activations_test.py +++ b/tf_keras/activations_test.py @@ -12,18 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras activation functions.""" +"""Tests for TF-Keras activation functions.""" import numpy as np import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras.layers.activation as activation_layers -from keras import activations -from keras import backend -from keras.layers import core -from keras.layers import serialization -from keras.testing_infra import test_combinations +import tf_keras.layers.activation as activation_layers +from tf_keras import activations +from tf_keras import backend +from tf_keras.layers import core +from tf_keras.layers import serialization +from tf_keras.testing_infra import test_combinations def _ref_softmax(values): diff --git a/tf_keras/api/BUILD b/tf_keras/api/BUILD new file mode 100644 index 000000000..a0abbe0e4 --- /dev/null +++ b/tf_keras/api/BUILD @@ -0,0 +1,95 @@ +# Description: +# Package for TF-Keras. + +# Placeholder: load unaliased py_binary +# Placeholder: load unaliased py_library +load("//tf_keras/api:api_gen.bzl", "generate_apis") +load("//tf_keras/api:api_init_files.bzl", "KERAS_API_INIT_FILES", "KERAS_API_INIT_FILES_V1") + +package( + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], + default_visibility = [ + "//tf_keras:friends", + "//third_party/py/tensorflow:__subpackages__", + ], + licenses = ["notice"], # Apache 2.0 License +) + +# The target used by PIP package which need to generate API init files during OSS build. +py_library( + name = "keras_api", + srcs = [ + ":keras_python_api_gen", + ":keras_python_api_gen_compat_v1", + ":keras_python_api_gen_compat_v2", + ], + srcs_version = "PY3", + deps = [ + "//:expect_tensorflow_installed", + "//tf_keras", + ], +) + +py_binary( + name = "extractor_wrapper", + srcs = ["extractor_wrapper.py"], + visibility = ["//visibility:public"], + deps = [ + "//:expect_absl_installed", # absl:app + # "//third_party/tensorflow/python/tools/api/generator2/extractor", + ], +) + +py_binary( + name = "generator_wrapper", + srcs = ["generator_wrapper.py"], + visibility = ["//visibility:public"], + deps = [ + "//:expect_absl_installed", # absl:app + # "//third_party/tensorflow/python/tools/api/generator2/generator", + ], +) + +generate_apis( + name = "keras_python_api_gen", + api_version = 1, + output_files = KERAS_API_INIT_FILES_V1, + output_package = "tf_keras.api", + deps = [ + "//:expect_tensorflow_installed", + "//tf_keras", + # "//third_party/tensorflow/lite/python:analyzer", + # "//third_party/tensorflow/lite/python:lite", + # "//third_party/tensorflow/lite/python/authoring", + ], +) + +generate_apis( + name = "keras_python_api_gen_compat_v1", + api_version = 1, + output_dir = "_v1/", + output_files = KERAS_API_INIT_FILES_V1, + output_package = "tf_keras.api._v1", + deps = [ + "//:expect_tensorflow_installed", + "//tf_keras", + # "//third_party/tensorflow/lite/python:analyzer", + # "//third_party/tensorflow/lite/python:lite", + # "//third_party/tensorflow/lite/python/authoring", + ], +) + +generate_apis( + name = "keras_python_api_gen_compat_v2", + api_version = 2, + output_dir = "_v2/", + output_files = KERAS_API_INIT_FILES, + output_package = "tf_keras.api._v2", + deps = [ + "//:expect_tensorflow_installed", + "//tf_keras", + # "//third_party/tensorflow/lite/python:analyzer", + # "//third_party/tensorflow/lite/python:lite", + # "//third_party/tensorflow/lite/python/authoring", + ], +) diff --git a/tf_keras/api/api_gen.bzl b/tf_keras/api/api_gen.bzl new file mode 100644 index 000000000..7fb44a31b --- /dev/null +++ b/tf_keras/api/api_gen.bzl @@ -0,0 +1,304 @@ +"""Rules to generate the TensorFlow public API from annotated files.""" + +# Placeholder: load if_indexing_source_code + +_TARGET_PATTERNS = [ + "//tf_keras:", + "//tf_keras/", +] + +_DECORATOR = "tensorflow.python.util.tf_export.keras_export" + +def _any_match(label): + full_target = "//" + label.package + ":" + label.name + for pattern in _TARGET_PATTERNS: + if pattern in full_target: + return True + return False + +def _join(path, *others): + result = path + + for p in others: + if not result or result.endswith("/"): + result += p + else: + result += "/" + p + + return result + +ApiInfo = provider( + doc = "Provider for API symbols and docstrings extracted from Python files.", + fields = { + "transitive_api": "depset of files with extracted API.", + }, +) + +def _py_files(f): + if f.basename.endswith(".py") or f.basename.endswith(".py3"): + return f.path + return None + +def _merge_py_info( + deps, + direct_sources = None, + direct_imports = None, + has_py2_only_sources = False, + has_py3_only_sources = False, + uses_shared_libraries = False): + transitive_sources = [] + transitive_imports = [] + for dep in deps: + if PyInfo in dep: + transitive_sources.append(dep[PyInfo].transitive_sources) + transitive_imports.append(dep[PyInfo].imports) + has_py2_only_sources = has_py2_only_sources or dep[PyInfo].has_py2_only_sources + has_py3_only_sources = has_py3_only_sources or dep[PyInfo].has_py3_only_sources + uses_shared_libraries = uses_shared_libraries or dep[PyInfo].uses_shared_libraries + + return PyInfo( + transitive_sources = depset(direct = direct_sources, transitive = transitive_sources), + imports = depset(direct = direct_imports, transitive = transitive_imports), + has_py2_only_sources = has_py2_only_sources, + has_py3_only_sources = has_py3_only_sources, + uses_shared_libraries = uses_shared_libraries, + ) + +def _merge_api_info( + deps, + direct_api = None): + transitive_api = [] + for dep in deps: + if ApiInfo in dep: + transitive_api.append(dep[ApiInfo].transitive_api) + return ApiInfo(transitive_api = depset(direct = direct_api, transitive = transitive_api)) + +def _api_extractor_impl(target, ctx): + direct_api = [] + + # Make sure the rule has a non-empty srcs attribute. + if ( + _any_match(target.label) and + hasattr(ctx.rule.attr, "srcs") and + ctx.rule.attr.srcs + ): + output = ctx.actions.declare_file("_".join([ + target.label.name, + "extracted_keras_api.json", + ])) + + args = ctx.actions.args() + args.set_param_file_format("multiline") + args.use_param_file("--flagfile=%s") + + args.add("--output", output) + args.add("--decorator", _DECORATOR) + args.add("--api_name", "keras") + args.add_all(ctx.rule.files.srcs, expand_directories = True, map_each = _py_files) + + ctx.actions.run( + mnemonic = "ExtractAPI", + executable = ctx.executable._extractor_bin, + inputs = ctx.rule.files.srcs, + outputs = [output], + arguments = [args], + progress_message = "Extracting keras APIs for %{label} to %{output}.", + use_default_shell_env = True, + ) + + direct_api.append(output) + + return [ + _merge_api_info(ctx.rule.attr.deps if hasattr(ctx.rule.attr, "deps") else [], direct_api = direct_api), + ] + +api_extractor = aspect( + doc = "Extracts the exported API for the given target and its dependencies.", + implementation = _api_extractor_impl, + attr_aspects = ["deps"], + provides = [ApiInfo], + # Currently the Python rules do not correctly advertise their providers. + # required_providers = [PyInfo], + attrs = { + "_extractor_bin": attr.label( + default = Label("//tf_keras/api:extractor_wrapper"), + executable = True, + cfg = "exec", + ), + }, +) + +def _extract_api_impl(ctx): + return [ + _merge_api_info(ctx.attr.deps), + _merge_py_info(ctx.attr.deps), + ] + +extract_api = rule( + doc = "Extract Python API for all targets in transitive dependencies.", + implementation = _extract_api_impl, + attrs = { + "deps": attr.label_list( + doc = "Targets to extract API from.", + allow_empty = False, + aspects = [api_extractor], + providers = [PyInfo], + mandatory = True, + ), + }, + provides = [ApiInfo, PyInfo], +) + +def _generate_api_impl(ctx): + args = ctx.actions.args() + args.set_param_file_format("multiline") + args.use_param_file("--flagfile=%s", use_always = True) + + args.add_joined("--output_files", ctx.outputs.output_files, join_with = ",") + args.add("--output_dir", _join(ctx.bin_dir.path, ctx.label.package, ctx.attr.output_dir)) + if ctx.file.root_init_template: + args.add("--root_init_template", ctx.file.root_init_template) + args.add("--apiversion", ctx.attr.api_version) + args.add_joined("--compat_api_versions", ctx.attr.compat_api_versions, join_with = ",") + args.add_joined("--compat_init_templates", ctx.files.compat_init_templates, join_with = ",") + args.add("--output_package", ctx.attr.output_package) + args.add_joined("--packages_to_ignore", ctx.attr.packages_to_ignore, join_with = ",") + if ctx.attr.use_lazy_loading: + args.add("--use_lazy_loading") + else: + args.add("--nouse_lazy_loading") + args.add_joined("--file_prefixes_to_strip", [ctx.bin_dir.path, ctx.genfiles_dir.path, "third_party/py"], join_with = ",") + + inputs = depset(transitive = [ + dep[ApiInfo].transitive_api + for dep in ctx.attr.deps + ]) + args.add_all( + inputs, + expand_directories = True, + ) + + transitive_inputs = [inputs] + if ctx.attr.root_init_template: + transitive_inputs.append(ctx.attr.root_init_template.files) + + ctx.actions.run( + mnemonic = "GenerateAPI", + executable = ctx.executable._generator_bin, + inputs = depset( + direct = ctx.files.compat_init_templates, + transitive = transitive_inputs, + ), + outputs = ctx.outputs.output_files, + arguments = [args], + progress_message = "Generating APIs for %{label} to %{output}.", + use_default_shell_env = True, + ) + +generate_api = rule( + doc = "Generate Python API for all targets in transitive dependencies.", + implementation = _generate_api_impl, + attrs = { + "deps": attr.label_list( + doc = "extract_api targets to generate API from.", + allow_empty = True, + providers = [ApiInfo, PyInfo], + mandatory = True, + ), + "root_init_template": attr.label( + doc = "Template for the top level __init__.py file", + allow_single_file = True, + ), + "api_version": attr.int( + doc = "The API version to generate (1 or 2)", + values = [1, 2], + ), + "compat_api_versions": attr.int_list( + doc = "Additional versions to generate in compat/ subdirectory.", + ), + "compat_init_templates": attr.label_list( + doc = "Template for top-level __init__files under compat modules. This list must be " + + "in the same order as the list of versions in compat_apiversions", + allow_files = True, + ), + "output_package": attr.string( + doc = "Root output package.", + ), + "output_dir": attr.string( + doc = "Subdirectory to output API to. If non-empty, must end with '/'.", + ), + "output_files": attr.output_list( + doc = "List of __init__.py files that should be generated. This list should include " + + "file name for every module exported using tf_export. For e.g. if an op is " + + "decorated with @tf_export('module1.module2', 'module3'). Then, output_files " + + "should include module1/module2/__init__.py and module3/__init__.py.", + ), + "use_lazy_loading": attr.bool( + doc = "If true, lazy load imports in the generated API rather then imporing them all statically.", + ), + "packages_to_ignore": attr.string_list( + doc = "List of packages to ignore tf_exports from.", + ), + "_generator_bin": attr.label( + default = Label("//tf_keras/api:generator_wrapper"), + executable = True, + cfg = "exec", + ), + }, +) + +def generate_apis( + name, + deps = [ + "//tf_keras", + ], + output_files = [], + root_init_template = None, + api_version = 2, + compat_api_versions = [], + compat_init_templates = [], + output_package = "tf_keras.api", + output_dir = "", + packages_to_ignore = [], + visibility = ["//visibility:public"]): + """Generate TensorFlow APIs for a set of libraries. + + Args: + name: name of generate_api target. + deps: python_library targets to serve as roots for extracting APIs. + output_files: The list of files that the API generator is exected to create. + root_init_template: The template for the top level __init__.py file generated. + "#API IMPORTS PLACEHOLDER" comment will be replaced with imports. + api_version: THhe API version to generate. (1 or 2) + compat_api_versions: Additional versions to generate in compat/ subdirectory. + compat_init_templates: Template for top level __init__.py files under the compat modules. + The list must be in the same order as the list of versions in 'compat_api_versions' + output_package: Root output package. + output_dir: Directory where the generated output files are placed. This should be a prefix + of every directory in 'output_files' + packages_to_ignore: List of packages to ignore tf_exports from. + visibility: Visibility of the target containing the generated files. + """ + extract_name = name + ".extract-keras" + extract_api( + name = extract_name, + deps = deps, + visibility = ["//visibility:private"], + ) + + all_output_files = [_join(output_dir, f) for f in output_files] + + generate_api( + name = name, + deps = [":" + extract_name], + output_files = all_output_files, + output_dir = output_dir, + root_init_template = root_init_template, + compat_api_versions = compat_api_versions, + compat_init_templates = compat_init_templates, + api_version = api_version, + visibility = visibility, + packages_to_ignore = packages_to_ignore, + use_lazy_loading = False, + output_package = output_package, + ) diff --git a/keras/api/api_init_files.bzl b/tf_keras/api/api_init_files.bzl similarity index 100% rename from keras/api/api_init_files.bzl rename to tf_keras/api/api_init_files.bzl diff --git a/tf_keras/api/extractor_wrapper.py b/tf_keras/api/extractor_wrapper.py new file mode 100644 index 000000000..1c6f998b4 --- /dev/null +++ b/tf_keras/api/extractor_wrapper.py @@ -0,0 +1,20 @@ +# Copyright 2023 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. +# ============================================================================== +"""Thin wrapper to call TensorFlow's API extractor script.""" +from absl import app +from tensorflow.python.tools.api.generator2.extractor import extractor + +if __name__ == "__main__": + app.run(extractor.main) diff --git a/tf_keras/api/generator_wrapper.py b/tf_keras/api/generator_wrapper.py new file mode 100644 index 000000000..d76451388 --- /dev/null +++ b/tf_keras/api/generator_wrapper.py @@ -0,0 +1,20 @@ +# Copyright 2023 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. +# ============================================================================== +"""Thin wrapper to call TensorFlow's API generator script.""" +from absl import app +from tensorflow.python.tools.api.generator2.generator import generator + +if __name__ == "__main__": + app.run(generator.main) diff --git a/keras/api/golden/BUILD b/tf_keras/api/golden/BUILD similarity index 79% rename from keras/api/golden/BUILD rename to tf_keras/api/golden/BUILD index 68d1e26f2..ad169d094 100644 --- a/keras/api/golden/BUILD +++ b/tf_keras/api/golden/BUILD @@ -1,7 +1,7 @@ # TensorFlow API backwards compatibility test goldens. package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = ["//visibility:public"], licenses = ["notice"], # Apache 2.0 ) diff --git a/keras/api/golden/v1/tensorflow.keras.-model.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.-model.pbtxt similarity index 98% rename from keras/api/golden/v1/tensorflow.keras.-model.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.-model.pbtxt index a867fb43e..12410a461 100644 --- a/keras/api/golden/v1/tensorflow.keras.-model.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.-model.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.Model" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.-sequential.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.-sequential.pbtxt similarity index 97% rename from keras/api/golden/v2/tensorflow.keras.-sequential.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.-sequential.pbtxt index fc9edeb88..da0ee6c22 100644 --- a/keras/api/golden/v2/tensorflow.keras.-sequential.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.-sequential.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.Sequential" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt index 68aa8fd65..18d445e48 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.__internal__.layers.BaseRandomLayer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.layers.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.layers.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.__internal__.layers.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.layers.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling1-d.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling1-d.pbtxt index b72400000..4b5d3d2ec 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling1-d.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.layers.AveragePooling1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling2-d.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling2-d.pbtxt index 509a218c1..cf5597a08 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling2-d.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.layers.AveragePooling2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling3-d.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling3-d.pbtxt index 4a4f88246..b1494cb72 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-average-pooling3-d.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.layers.AveragePooling3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-batch-normalization.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-batch-normalization.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-batch-normalization.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-batch-normalization.pbtxt index 77ae4cffe..ba0072429 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-batch-normalization.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-batch-normalization.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.layers.BatchNormalization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv1-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv1-d.pbtxt index 70cef7d56..8a7b3dc80 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv1-d.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.layers.Conv1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d-transpose.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d-transpose.pbtxt similarity index 92% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d-transpose.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d-transpose.pbtxt index 2a1dc3989..282132e8a 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d-transpose.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d-transpose.pbtxt @@ -1,16 +1,16 @@ path: "tensorflow.keras.__internal__.legacy.layers.Conv2DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d.pbtxt index 3562610db..e525acb7e 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv2-d.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.layers.Conv2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d-transpose.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d-transpose.pbtxt similarity index 92% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d-transpose.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d-transpose.pbtxt index 743619e04..dd1e6fda9 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d-transpose.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d-transpose.pbtxt @@ -1,16 +1,16 @@ path: "tensorflow.keras.__internal__.legacy.layers.Conv3DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d.pbtxt index 1975283a7..163260332 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-conv3-d.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.layers.Conv3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dense.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dense.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dense.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dense.pbtxt index 9c3540980..2a7e4ce69 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dense.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dense.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.__internal__.legacy.layers.Dense" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dropout.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dropout.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dropout.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dropout.pbtxt index 99f55801f..66b364efa 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dropout.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-dropout.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.layers.Dropout" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-flatten.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-flatten.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-flatten.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-flatten.pbtxt index d390aade0..a3d151119 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-flatten.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-flatten.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.__internal__.legacy.layers.Flatten" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-input-spec.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-input-spec.pbtxt similarity index 91% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-input-spec.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-input-spec.pbtxt index 0f44da5f6..6421e356a 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-input-spec.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-input-spec.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.__internal__.legacy.layers.InputSpec" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-layer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-layer.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-layer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-layer.pbtxt index fa5c90d9b..dfca28ce6 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-layer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-layer.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.__internal__.legacy.layers.Layer" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling1-d.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling1-d.pbtxt index 5a57d0d4f..018fb6a9a 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling1-d.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.layers.MaxPooling1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling2-d.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling2-d.pbtxt index f0a9659a6..dddebb6a1 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling2-d.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.layers.MaxPooling2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling3-d.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling3-d.pbtxt index dd0436a58..49e0f4245 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-max-pooling3-d.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.layers.MaxPooling3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv1-d.pbtxt similarity index 92% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv1-d.pbtxt index f1169e363..f7a9e2847 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv1-d.pbtxt @@ -1,16 +1,16 @@ path: "tensorflow.keras.__internal__.legacy.layers.SeparableConv1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv2-d.pbtxt similarity index 92% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv2-d.pbtxt index 9815b88f8..3136e8f2e 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.-separable-conv2-d.pbtxt @@ -1,16 +1,16 @@ path: "tensorflow.keras.__internal__.legacy.layers.SeparableConv2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.experimental.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.experimental.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.experimental.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.experimental.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.layers.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-l-s-t-m-cell.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-l-s-t-m-cell.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-l-s-t-m-cell.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-l-s-t-m-cell.pbtxt index 91129cd63..dab70d955 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-l-s-t-m-cell.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-l-s-t-m-cell.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.rnn_cell.BasicLSTMCell" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-r-n-n-cell.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-r-n-n-cell.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-r-n-n-cell.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-r-n-n-cell.pbtxt index a056b2db7..c1a7839ad 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-r-n-n-cell.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-basic-r-n-n-cell.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.rnn_cell.BasicRNNCell" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-device-wrapper.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-device-wrapper.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-device-wrapper.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-device-wrapper.pbtxt index 06e5a0742..a02349445 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-device-wrapper.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-device-wrapper.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.rnn_cell.DeviceWrapper" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-dropout-wrapper.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-dropout-wrapper.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-dropout-wrapper.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-dropout-wrapper.pbtxt index 560abe76d..8bdb21b1e 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-dropout-wrapper.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-dropout-wrapper.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.rnn_cell.DropoutWrapper" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-g-r-u-cell.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-g-r-u-cell.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-g-r-u-cell.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-g-r-u-cell.pbtxt index f047c7b16..c62e34a11 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-g-r-u-cell.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-g-r-u-cell.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.rnn_cell.GRUCell" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-cell.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-cell.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-cell.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-cell.pbtxt index 917b7da63..57ee3a5c1 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-cell.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-cell.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.rnn_cell.LSTMCell" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-state-tuple.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-state-tuple.pbtxt similarity index 73% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-state-tuple.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-state-tuple.pbtxt index 3f2cb22ad..82db14297 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-state-tuple.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-l-s-t-m-state-tuple.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.__internal__.legacy.rnn_cell.LSTMStateTuple" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "c" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-multi-r-n-n-cell.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-multi-r-n-n-cell.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-multi-r-n-n-cell.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-multi-r-n-n-cell.pbtxt index b87a10774..ddfafa107 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-multi-r-n-n-cell.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-multi-r-n-n-cell.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.__internal__.legacy.rnn_cell.MultiRNNCell" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-r-n-n-cell.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-r-n-n-cell.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-r-n-n-cell.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-r-n-n-cell.pbtxt index b12bdab44..cd510f628 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-r-n-n-cell.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-r-n-n-cell.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.__internal__.legacy.rnn_cell.RNNCell" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-residual-wrapper.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-residual-wrapper.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-residual-wrapper.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-residual-wrapper.pbtxt index 0c537a8bd..2a923c531 100644 --- a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-residual-wrapper.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.-residual-wrapper.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.__internal__.legacy.rnn_cell.ResidualWrapper" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.legacy.rnn_cell.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.__internal__.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.__internal__.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.__internal__.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.__internal__.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.activations.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.activations.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.activations.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.activations.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.convnext.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.convnext.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.convnext.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.convnext.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.densenet.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.densenet.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.densenet.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.densenet.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.efficientnet.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.efficientnet.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.efficientnet.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.efficientnet.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.efficientnet_v2.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.efficientnet_v2.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.efficientnet_v2.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.efficientnet_v2.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.imagenet_utils.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.imagenet_utils.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.imagenet_utils.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.imagenet_utils.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.inception_resnet_v2.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.inception_resnet_v2.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.inception_resnet_v2.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.inception_resnet_v2.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.inception_v3.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.inception_v3.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.inception_v3.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.inception_v3.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.mobilenet.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.mobilenet.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.mobilenet.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.mobilenet.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.mobilenet_v2.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.mobilenet_v2.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.mobilenet_v2.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.mobilenet_v2.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.mobilenet_v3.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.mobilenet_v3.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.mobilenet_v3.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.mobilenet_v3.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.nasnet.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.nasnet.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.nasnet.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.nasnet.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.regnet.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.regnet.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.regnet.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.regnet.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.resnet.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.resnet.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.resnet.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.resnet.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.resnet50.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.resnet50.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.resnet50.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.resnet50.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.resnet_rs.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.resnet_rs.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.resnet_rs.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.resnet_rs.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.resnet_v2.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.resnet_v2.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.resnet_v2.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.resnet_v2.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.vgg16.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.vgg16.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.vgg16.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.vgg16.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.vgg19.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.vgg19.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.vgg19.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.vgg19.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.applications.xception.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.applications.xception.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.applications.xception.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.applications.xception.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.backend.name_scope.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.backend.name_scope.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.backend.name_scope.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.backend.name_scope.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.backend.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.backend.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.backend.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.backend.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-base-logger.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-base-logger.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-base-logger.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-base-logger.pbtxt index 3a8597db7..4f48ea20a 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-base-logger.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-base-logger.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.BaseLogger" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt index fbeada729..33698bcd0 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.CSVLogger" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-callback-list.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-callback-list.pbtxt similarity index 98% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-callback-list.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-callback-list.pbtxt index d3b5171b2..e9c305646 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-callback-list.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-callback-list.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.callbacks.CallbackList" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-callback.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-callback.pbtxt similarity index 98% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-callback.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-callback.pbtxt index faa4541b7..c39ad8fc2 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-callback.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-callback.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.callbacks.Callback" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-early-stopping.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-early-stopping.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-early-stopping.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-early-stopping.pbtxt index 2f6f3059b..93c18f904 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-early-stopping.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-early-stopping.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.EarlyStopping" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-history.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-history.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-history.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-history.pbtxt index 379a9f3aa..24e8c189f 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-history.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-history.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.History" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-lambda-callback.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-lambda-callback.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-lambda-callback.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-lambda-callback.pbtxt index 61c47980e..b4ee05a7f 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-lambda-callback.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-lambda-callback.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.LambdaCallback" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt index 02a8faf67..6024f4aff 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.LearningRateScheduler" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-model-checkpoint.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-model-checkpoint.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-model-checkpoint.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-model-checkpoint.pbtxt index e13044336..0dd015ba6 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-model-checkpoint.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-model-checkpoint.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.ModelCheckpoint" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-progbar-logger.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-progbar-logger.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-progbar-logger.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-progbar-logger.pbtxt index e8f92604b..c5bf280ed 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-progbar-logger.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-progbar-logger.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.ProgbarLogger" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt index a7792b964..c753fc75e 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.ReduceLROnPlateau" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-remote-monitor.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-remote-monitor.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-remote-monitor.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-remote-monitor.pbtxt index 98552f19d..e1da16a95 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-remote-monitor.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-remote-monitor.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.RemoteMonitor" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt index 0a33bbb4e..edc7755a1 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.callbacks.SidecarEvaluatorModelExport" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-tensor-board.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-tensor-board.pbtxt similarity index 92% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-tensor-board.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-tensor-board.pbtxt index ca8b6dd18..3ce41bb88 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-tensor-board.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-tensor-board.pbtxt @@ -1,9 +1,9 @@ path: "tensorflow.keras.callbacks.TensorBoard" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt index 62ccd1ec2..bb72b7127 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.TerminateOnNaN" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.callbacks.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.callbacks.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.callbacks.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.constraints.-constraint.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.constraints.-constraint.pbtxt similarity index 86% rename from keras/api/golden/v2/tensorflow.keras.constraints.-constraint.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.constraints.-constraint.pbtxt index ebce5a630..326d23164 100644 --- a/keras/api/golden/v2/tensorflow.keras.constraints.-constraint.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.constraints.-constraint.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.constraints.Constraint" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.constraints.-max-norm.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.constraints.-max-norm.pbtxt similarity index 80% rename from keras/api/golden/v2/tensorflow.keras.constraints.-max-norm.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.constraints.-max-norm.pbtxt index 751357a36..5173b8775 100644 --- a/keras/api/golden/v2/tensorflow.keras.constraints.-max-norm.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.constraints.-max-norm.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.MaxNorm" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.constraints.-min-max-norm.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.constraints.-min-max-norm.pbtxt similarity index 81% rename from keras/api/golden/v2/tensorflow.keras.constraints.-min-max-norm.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.constraints.-min-max-norm.pbtxt index f385c813c..fac9eb7fe 100644 --- a/keras/api/golden/v2/tensorflow.keras.constraints.-min-max-norm.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.constraints.-min-max-norm.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.MinMaxNorm" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.constraints.-non-neg.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.constraints.-non-neg.pbtxt similarity index 76% rename from keras/api/golden/v1/tensorflow.keras.constraints.-non-neg.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.constraints.-non-neg.pbtxt index ab3251209..7cf8702d3 100644 --- a/keras/api/golden/v1/tensorflow.keras.constraints.-non-neg.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.constraints.-non-neg.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.NonNeg" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.constraints.-radial-constraint.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.constraints.-radial-constraint.pbtxt similarity index 75% rename from keras/api/golden/v2/tensorflow.keras.constraints.-radial-constraint.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.constraints.-radial-constraint.pbtxt index 54e6adf3e..b476ee545 100644 --- a/keras/api/golden/v2/tensorflow.keras.constraints.-radial-constraint.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.constraints.-radial-constraint.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.RadialConstraint" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.constraints.-unit-norm.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.constraints.-unit-norm.pbtxt similarity index 79% rename from keras/api/golden/v2/tensorflow.keras.constraints.-unit-norm.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.constraints.-unit-norm.pbtxt index b821bbb8a..402057a15 100644 --- a/keras/api/golden/v2/tensorflow.keras.constraints.-unit-norm.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.constraints.-unit-norm.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.UnitNorm" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.constraints.max_norm.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.constraints.max_norm.pbtxt similarity index 80% rename from keras/api/golden/v1/tensorflow.keras.constraints.max_norm.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.constraints.max_norm.pbtxt index 42aeaf7e0..e46433861 100644 --- a/keras/api/golden/v1/tensorflow.keras.constraints.max_norm.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.constraints.max_norm.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.max_norm" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.constraints.min_max_norm.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.constraints.min_max_norm.pbtxt similarity index 81% rename from keras/api/golden/v1/tensorflow.keras.constraints.min_max_norm.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.constraints.min_max_norm.pbtxt index 47ab0d110..9efd9bea0 100644 --- a/keras/api/golden/v1/tensorflow.keras.constraints.min_max_norm.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.constraints.min_max_norm.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.min_max_norm" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.constraints.non_neg.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.constraints.non_neg.pbtxt similarity index 76% rename from keras/api/golden/v2/tensorflow.keras.constraints.non_neg.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.constraints.non_neg.pbtxt index 0a8c23153..aaeedf64c 100644 --- a/keras/api/golden/v2/tensorflow.keras.constraints.non_neg.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.constraints.non_neg.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.non_neg" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.constraints.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.constraints.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.constraints.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.constraints.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.constraints.radial_constraint.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.constraints.radial_constraint.pbtxt similarity index 75% rename from keras/api/golden/v1/tensorflow.keras.constraints.radial_constraint.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.constraints.radial_constraint.pbtxt index 78d401b28..e148bc564 100644 --- a/keras/api/golden/v1/tensorflow.keras.constraints.radial_constraint.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.constraints.radial_constraint.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.radial_constraint" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.constraints.unit_norm.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.constraints.unit_norm.pbtxt similarity index 80% rename from keras/api/golden/v1/tensorflow.keras.constraints.unit_norm.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.constraints.unit_norm.pbtxt index 137cb505e..9a32c6232 100644 --- a/keras/api/golden/v1/tensorflow.keras.constraints.unit_norm.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.constraints.unit_norm.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.unit_norm" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.datasets.boston_housing.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.datasets.boston_housing.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.datasets.boston_housing.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.datasets.boston_housing.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.datasets.cifar10.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.datasets.cifar10.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.datasets.cifar10.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.datasets.cifar10.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.datasets.cifar100.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.datasets.cifar100.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.datasets.cifar100.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.datasets.cifar100.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.datasets.fashion_mnist.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.datasets.fashion_mnist.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.datasets.fashion_mnist.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.datasets.fashion_mnist.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.datasets.imdb.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.datasets.imdb.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.datasets.imdb.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.datasets.imdb.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.datasets.mnist.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.datasets.mnist.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.datasets.mnist.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.datasets.mnist.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.datasets.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.datasets.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.datasets.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.datasets.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.datasets.reuters.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.datasets.reuters.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.datasets.reuters.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.datasets.reuters.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.estimator.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.estimator.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.estimator.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.estimator.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt similarity index 74% rename from keras/api/golden/v1/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt index 4e15111ec..143235cc5 100644 --- a/keras/api/golden/v1/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.experimental.CosineDecayRestarts" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.experimental.-cosine-decay.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.experimental.-cosine-decay.pbtxt similarity index 75% rename from keras/api/golden/v1/tensorflow.keras.experimental.-cosine-decay.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.experimental.-cosine-decay.pbtxt index 81bdedcb4..84321bf39 100644 --- a/keras/api/golden/v1/tensorflow.keras.experimental.-cosine-decay.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.experimental.-cosine-decay.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.experimental.CosineDecay" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.experimental.-linear-model.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.experimental.-linear-model.pbtxt similarity index 97% rename from keras/api/golden/v2/tensorflow.keras.experimental.-linear-model.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.experimental.-linear-model.pbtxt index 8301a6583..97d400bf0 100644 --- a/keras/api/golden/v2/tensorflow.keras.experimental.-linear-model.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.experimental.-linear-model.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.experimental.LinearModel" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.experimental.-sequence-features.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.experimental.-sequence-features.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.experimental.-sequence-features.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.experimental.-sequence-features.pbtxt index e87a1ec3d..a4f2412d9 100644 --- a/keras/api/golden/v1/tensorflow.keras.experimental.-sequence-features.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.experimental.-sequence-features.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.experimental.SequenceFeatures" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.experimental.-wide-deep-model.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.experimental.-wide-deep-model.pbtxt similarity index 97% rename from keras/api/golden/v2/tensorflow.keras.experimental.-wide-deep-model.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.experimental.-wide-deep-model.pbtxt index 44e02e9b4..dfa4ae041 100644 --- a/keras/api/golden/v2/tensorflow.keras.experimental.-wide-deep-model.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.experimental.-wide-deep-model.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.experimental.WideDeepModel" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.experimental.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.experimental.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.experimental.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.experimental.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.export.-export-archive.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.export.-export-archive.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.export.-export-archive.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.export.-export-archive.pbtxt index 4b245b4b9..991e586ea 100644 --- a/keras/api/golden/v1/tensorflow.keras.export.-export-archive.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.export.-export-archive.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.export.ExportArchive" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v1/tensorflow.keras.export.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.export.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.export.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.export.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.-constant.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-constant.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.-constant.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.-constant.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.-identity.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-identity.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.-identity.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.-identity.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-initializer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-initializer.pbtxt similarity index 83% rename from keras/api/golden/v2/tensorflow.keras.initializers.-initializer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.-initializer.pbtxt index 848e5d352..809c91209 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-initializer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-initializer.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.Initializer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.-ones.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-ones.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.-ones.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.-ones.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.-orthogonal.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-orthogonal.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.-orthogonal.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.-orthogonal.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.-random-normal.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-random-normal.pbtxt similarity index 89% rename from keras/api/golden/v1/tensorflow.keras.initializers.-random-normal.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.-random-normal.pbtxt index 06cb91b66..dfb6035d0 100644 --- a/keras/api/golden/v1/tensorflow.keras.initializers.-random-normal.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-random-normal.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.RandomNormal" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.-random-uniform.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-random-uniform.pbtxt similarity index 89% rename from keras/api/golden/v1/tensorflow.keras.initializers.-random-uniform.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.-random-uniform.pbtxt index 5b33476ee..7450dc145 100644 --- a/keras/api/golden/v1/tensorflow.keras.initializers.-random-uniform.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-random-uniform.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.RandomUniform" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.-truncated-normal.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-truncated-normal.pbtxt similarity index 89% rename from keras/api/golden/v1/tensorflow.keras.initializers.-truncated-normal.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.-truncated-normal.pbtxt index a5815daa9..d1929de30 100644 --- a/keras/api/golden/v1/tensorflow.keras.initializers.-truncated-normal.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-truncated-normal.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.TruncatedNormal" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.-variance-scaling.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-variance-scaling.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.-variance-scaling.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.-variance-scaling.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.-zeros.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.-zeros.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.-zeros.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.-zeros.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.constant.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.constant.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.constant.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.constant.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.glorot_normal.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.glorot_normal.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.glorot_normal.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.glorot_normal.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.glorot_uniform.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.glorot_uniform.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.glorot_uniform.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.glorot_uniform.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.he_normal.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.he_normal.pbtxt similarity index 89% rename from keras/api/golden/v1/tensorflow.keras.initializers.he_normal.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.he_normal.pbtxt index 4d1f9b815..0579f11f0 100644 --- a/keras/api/golden/v1/tensorflow.keras.initializers.he_normal.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.initializers.he_normal.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.he_normal" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.he_uniform.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.he_uniform.pbtxt similarity index 89% rename from keras/api/golden/v1/tensorflow.keras.initializers.he_uniform.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.he_uniform.pbtxt index bf4296a74..1f3183157 100644 --- a/keras/api/golden/v1/tensorflow.keras.initializers.he_uniform.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.initializers.he_uniform.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.he_uniform" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.identity.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.identity.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.identity.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.identity.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.lecun_normal.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.lecun_normal.pbtxt similarity index 88% rename from keras/api/golden/v1/tensorflow.keras.initializers.lecun_normal.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.lecun_normal.pbtxt index 144c9f992..223ca9653 100644 --- a/keras/api/golden/v1/tensorflow.keras.initializers.lecun_normal.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.initializers.lecun_normal.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.lecun_normal" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.lecun_uniform.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.lecun_uniform.pbtxt similarity index 88% rename from keras/api/golden/v1/tensorflow.keras.initializers.lecun_uniform.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.lecun_uniform.pbtxt index 4f73d9281..59aa7db97 100644 --- a/keras/api/golden/v1/tensorflow.keras.initializers.lecun_uniform.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.initializers.lecun_uniform.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.lecun_uniform" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.normal.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.normal.pbtxt similarity index 89% rename from keras/api/golden/v1/tensorflow.keras.initializers.normal.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.normal.pbtxt index dc3bb2b8a..d7a6488bb 100644 --- a/keras/api/golden/v1/tensorflow.keras.initializers.normal.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.initializers.normal.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.normal" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.ones.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.ones.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.ones.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.ones.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.orthogonal.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.orthogonal.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.orthogonal.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.orthogonal.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.random_normal.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.random_normal.pbtxt similarity index 89% rename from keras/api/golden/v1/tensorflow.keras.initializers.random_normal.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.random_normal.pbtxt index 985d4dd52..738c7d8dd 100644 --- a/keras/api/golden/v1/tensorflow.keras.initializers.random_normal.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.initializers.random_normal.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.random_normal" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.random_uniform.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.random_uniform.pbtxt similarity index 89% rename from keras/api/golden/v1/tensorflow.keras.initializers.random_uniform.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.random_uniform.pbtxt index caf51f1fd..5211ed731 100644 --- a/keras/api/golden/v1/tensorflow.keras.initializers.random_uniform.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.initializers.random_uniform.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.random_uniform" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.truncated_normal.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.truncated_normal.pbtxt similarity index 89% rename from keras/api/golden/v1/tensorflow.keras.initializers.truncated_normal.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.truncated_normal.pbtxt index beaee23b8..92c421fe0 100644 --- a/keras/api/golden/v1/tensorflow.keras.initializers.truncated_normal.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.initializers.truncated_normal.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.truncated_normal" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.uniform.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.uniform.pbtxt similarity index 89% rename from keras/api/golden/v1/tensorflow.keras.initializers.uniform.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.uniform.pbtxt index f50e925b0..18583dcc3 100644 --- a/keras/api/golden/v1/tensorflow.keras.initializers.uniform.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.initializers.uniform.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.uniform" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.zeros.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.initializers.zeros.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.initializers.zeros.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.initializers.zeros.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt index d7238394f..748671348 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.AbstractRNNCell" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-activation.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-activation.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-activation.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-activation.pbtxt index d1ee21e3e..ae03ae751 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-activation.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-activation.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Activation" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-activity-regularization.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-activity-regularization.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-activity-regularization.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-activity-regularization.pbtxt index 8c47a6125..a7b62bd7b 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-activity-regularization.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-activity-regularization.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ActivityRegularization" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-add.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-add.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-add.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-add.pbtxt index 5127ff3df..aa163d114 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-add.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-add.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Add" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-additive-attention.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-additive-attention.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-additive-attention.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-additive-attention.pbtxt index 8ed84a4a7..c5c19885b 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-additive-attention.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-additive-attention.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.AdditiveAttention" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-alpha-dropout.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-alpha-dropout.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-alpha-dropout.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-alpha-dropout.pbtxt index b65b0c1c1..62d5c778e 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-alpha-dropout.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-alpha-dropout.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AlphaDropout" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-attention.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-attention.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-attention.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-attention.pbtxt index c8c3027e9..64d449869 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-attention.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-attention.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Attention" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-average-pooling1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-average-pooling1-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-average-pooling1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-average-pooling1-d.pbtxt index d1d687125..955df3fc9 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-average-pooling1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-average-pooling1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AveragePooling1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-average-pooling2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-average-pooling2-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-average-pooling2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-average-pooling2-d.pbtxt index c3c3f7027..ffb2fc00b 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-average-pooling2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-average-pooling2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AveragePooling2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-average-pooling3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-average-pooling3-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-average-pooling3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-average-pooling3-d.pbtxt index cdd976ab9..eccd897d6 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-average-pooling3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-average-pooling3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AveragePooling3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-average.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-average.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-average.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-average.pbtxt index 5552bd555..73d7f8548 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-average.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-average.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Average" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-avg-pool1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-avg-pool1-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-avg-pool1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-avg-pool1-d.pbtxt index 0fb5acc44..6f192d650 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-avg-pool1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-avg-pool1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AvgPool1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-avg-pool2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-avg-pool2-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-avg-pool2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-avg-pool2-d.pbtxt index b46848ddf..b81fce3d4 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-avg-pool2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-avg-pool2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AvgPool2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-avg-pool3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-avg-pool3-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-avg-pool3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-avg-pool3-d.pbtxt index c5f4a9b9b..208cd87c5 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-avg-pool3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-avg-pool3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AvgPool3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-batch-normalization.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-batch-normalization.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-batch-normalization.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-batch-normalization.pbtxt index 81ab7531f..2b3ced637 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-batch-normalization.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-batch-normalization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.BatchNormalization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-bidirectional.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-bidirectional.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-bidirectional.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-bidirectional.pbtxt index 4df4de922..b1c65fca1 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-bidirectional.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-bidirectional.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Bidirectional" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-category-encoding.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-category-encoding.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-category-encoding.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-category-encoding.pbtxt index dfa0cbaba..217a29b3a 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-category-encoding.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-category-encoding.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.CategoryEncoding" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-center-crop.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-center-crop.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-center-crop.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-center-crop.pbtxt index c4a5aa0e3..a1f56746a 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-center-crop.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-center-crop.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.CenterCrop" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-concatenate.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-concatenate.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-concatenate.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-concatenate.pbtxt index 229006d48..aff64158f 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-concatenate.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-concatenate.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Concatenate" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt index 13da3b785..111a67608 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.layers.ConvLSTM1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activation" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt index 341d73a2c..16e781b78 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.layers.ConvLSTM2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activation" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt index e6257107a..40b7c80fa 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.layers.ConvLSTM3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activation" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-conv1-d-transpose.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv1-d-transpose.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-conv1-d-transpose.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-conv1-d-transpose.pbtxt index 5b3beb8b1..0059d2b8b 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-conv1-d-transpose.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv1-d-transpose.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Conv1DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-conv1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv1-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-conv1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-conv1-d.pbtxt index 5dff50a6f..59c5243c5 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-conv1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Conv1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-conv2-d-transpose.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv2-d-transpose.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-conv2-d-transpose.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-conv2-d-transpose.pbtxt index 67f03d1ce..2a621f0a8 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-conv2-d-transpose.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv2-d-transpose.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Conv2DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-conv2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv2-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-conv2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-conv2-d.pbtxt index 7413b8674..2202bd4bd 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-conv2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Conv2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-conv3-d-transpose.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv3-d-transpose.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-conv3-d-transpose.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-conv3-d-transpose.pbtxt index c66d6ffb3..0f36f535a 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-conv3-d-transpose.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv3-d-transpose.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Conv3DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-conv3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv3-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-conv3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-conv3-d.pbtxt index 5c0774f96..347e6e087 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-conv3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-conv3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Conv3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt index 7484ce7eb..3a3ed5080 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Convolution1DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-convolution1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution1-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-convolution1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution1-d.pbtxt index 418e5d2b6..4e383afa8 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-convolution1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Convolution1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt index dc4369ec9..ca0345a6c 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Convolution2DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-convolution2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution2-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-convolution2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution2-d.pbtxt index 47258f583..810411ee3 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-convolution2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Convolution2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt index 8219381a5..7d3245a50 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Convolution3DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-convolution3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution3-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-convolution3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution3-d.pbtxt index b334463bb..32c2cb0f3 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-convolution3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-convolution3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Convolution3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-cropping1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-cropping1-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-cropping1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-cropping1-d.pbtxt index 1d516ece0..68a3969d1 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-cropping1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-cropping1-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Cropping1D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-cropping2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-cropping2-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-cropping2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-cropping2-d.pbtxt index 569ff8d26..d1d55a037 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-cropping2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-cropping2-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Cropping2D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-cropping3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-cropping3-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-cropping3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-cropping3-d.pbtxt index 0d1f2865f..f1cfc55d2 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-cropping3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-cropping3-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Cropping3D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-g-r-u.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-g-r-u.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-g-r-u.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-g-r-u.pbtxt index 1827cda0c..9a6d0bb95 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-g-r-u.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-g-r-u.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.CuDNNGRU" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-l-s-t-m.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-l-s-t-m.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-l-s-t-m.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-l-s-t-m.pbtxt index cdad1bfac..8ab46499b 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-l-s-t-m.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-cu-d-n-n-l-s-t-m.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.CuDNNLSTM" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-dense-features.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-dense-features.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-dense-features.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-dense-features.pbtxt index 4e91e6e67..4e8078f80 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-dense-features.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-dense-features.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.DenseFeatures" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-dense.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-dense.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.layers.-dense.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-dense.pbtxt index b29161038..bd769b50d 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-dense.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-dense.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Dense" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt index 5d3179479..ef151373c 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.DepthwiseConv1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt index 42f987270..56829d58d 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.DepthwiseConv2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-discretization.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-discretization.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-discretization.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-discretization.pbtxt index 5563d6138..f6bf75e7d 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-discretization.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-discretization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Discretization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-dot.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-dot.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-dot.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-dot.pbtxt index a43e3ea8e..b1782d8fe 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-dot.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-dot.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Dot" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-dropout.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-dropout.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-dropout.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-dropout.pbtxt index 0c504b387..204209656 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-dropout.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-dropout.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Dropout" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-e-l-u.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-e-l-u.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-e-l-u.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-e-l-u.pbtxt index 338f8569b..efbaa4268 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-e-l-u.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-e-l-u.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ELU" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-einsum-dense.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-einsum-dense.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-einsum-dense.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-einsum-dense.pbtxt index 0d878e1b6..4afe8b5d1 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-einsum-dense.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-einsum-dense.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.EinsumDense" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-embedding.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-embedding.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.layers.-embedding.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-embedding.pbtxt index d0acb29f4..762b2049b 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-embedding.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-embedding.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Embedding" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-flatten.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-flatten.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-flatten.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-flatten.pbtxt index 26ff20793..625d87e69 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-flatten.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-flatten.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Flatten" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-g-r-u-cell.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-g-r-u-cell.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-g-r-u-cell.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-g-r-u-cell.pbtxt index f6fe569b9..20d51d8c6 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-g-r-u-cell.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-g-r-u-cell.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.layers.GRUCell" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-g-r-u.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-g-r-u.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.layers.-g-r-u.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-g-r-u.pbtxt index a6e6dec7d..56475e0ab 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-g-r-u.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-g-r-u.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GRU" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activation" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-gaussian-dropout.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-gaussian-dropout.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-gaussian-dropout.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-gaussian-dropout.pbtxt index cfafd9e73..635bfb14f 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-gaussian-dropout.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-gaussian-dropout.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GaussianDropout" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-gaussian-noise.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-gaussian-noise.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-gaussian-noise.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-gaussian-noise.pbtxt index 03c265aeb..1e72a1e74 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-gaussian-noise.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-gaussian-noise.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GaussianNoise" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt index aaffbb424..c0b86e19b 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalAveragePooling1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt index 5a5d64006..3e455cd4b 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalAveragePooling2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt index d211a3a0a..2db1c9e58 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalAveragePooling3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt index f98c5fe73..a7f80fc01 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalAvgPool1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt index 93ccb22cc..c3939a4ff 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalAvgPool2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt index f8a2802d8..74efb12d7 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalAvgPool3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool1-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool1-d.pbtxt index 0c9d82c99..6efa24aaf 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalMaxPool1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool2-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool2-d.pbtxt index 6aa97dfdc..02ef5bf93 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalMaxPool2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool3-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool3-d.pbtxt index 80177870b..b9f013160 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalMaxPool3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt index 8b9a4c6e7..43f509984 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalMaxPooling1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt index 8f4bf30b4..7f3bdc34c 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalMaxPooling2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt index b165d9842..e902b91b6 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalMaxPooling3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-hashing.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-hashing.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-hashing.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-hashing.pbtxt index ef1b9e56c..92b0ef1b6 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-hashing.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-hashing.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Hashing" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-identity.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-identity.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-identity.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-identity.pbtxt index 3c3e39996..af2a92d4b 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-identity.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-identity.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Identity" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-input-layer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-input-layer.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-input-layer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-input-layer.pbtxt index 7564a7f8b..e5b3e97d3 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-input-layer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-input-layer.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.InputLayer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-input-spec.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-input-spec.pbtxt similarity index 90% rename from keras/api/golden/v1/tensorflow.keras.layers.-input-spec.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-input-spec.pbtxt index 6f146e09d..5aef9ca71 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-input-spec.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-input-spec.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.layers.InputSpec" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt index b86e2487a..df20da249 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.layers.LSTMCell" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-l-s-t-m.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-l-s-t-m.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.layers.-l-s-t-m.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-l-s-t-m.pbtxt index 07d70ebe6..58cb048e8 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-l-s-t-m.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-l-s-t-m.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.LSTM" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activation" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-lambda.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-lambda.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-lambda.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-lambda.pbtxt index bb97d088d..f62727dec 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-lambda.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-lambda.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Lambda" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-layer-normalization.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-layer-normalization.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-layer-normalization.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-layer-normalization.pbtxt index 1a81ce6f1..b693a8f04 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-layer-normalization.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-layer-normalization.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.LayerNormalization" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-layer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-layer.pbtxt similarity index 97% rename from keras/api/golden/v2/tensorflow.keras.layers.-layer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-layer.pbtxt index b50481b62..c5db2db8a 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-layer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-layer.pbtxt @@ -1,10 +1,10 @@ path: "tensorflow.keras.layers.Layer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-leaky-re-l-u.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-leaky-re-l-u.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-leaky-re-l-u.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-leaky-re-l-u.pbtxt index 96cc14f91..8df259864 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-leaky-re-l-u.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-leaky-re-l-u.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.LeakyReLU" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-locally-connected1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-locally-connected1-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-locally-connected1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-locally-connected1-d.pbtxt index f8b6b11e2..d6ea87ea9 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-locally-connected1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-locally-connected1-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.LocallyConnected1D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-locally-connected2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-locally-connected2-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-locally-connected2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-locally-connected2-d.pbtxt index fb34dfb1c..e450854e5 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-locally-connected2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-locally-connected2-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.LocallyConnected2D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-masking.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-masking.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-masking.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-masking.pbtxt index cb3ac42a4..8e565b108 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-masking.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-masking.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Masking" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-max-pool1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pool1-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-max-pool1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pool1-d.pbtxt index 0d9dc7499..d39cc3399 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-max-pool1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pool1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.MaxPool1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-max-pool2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pool2-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-max-pool2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pool2-d.pbtxt index e1092bf07..9fcdea298 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-max-pool2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pool2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.MaxPool2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-max-pool3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pool3-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-max-pool3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pool3-d.pbtxt index 4696c5863..8c66e26f8 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-max-pool3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pool3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.MaxPool3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-max-pooling1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pooling1-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-max-pooling1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pooling1-d.pbtxt index a021d15e3..977c8d409 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-max-pooling1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pooling1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.MaxPooling1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-max-pooling2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pooling2-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-max-pooling2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pooling2-d.pbtxt index 8bea460ac..971cf5d84 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-max-pooling2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pooling2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.MaxPooling2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-max-pooling3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pooling3-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-max-pooling3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pooling3-d.pbtxt index 14a7d00de..25451d194 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-max-pooling3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-max-pooling3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.MaxPooling3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-maximum.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-maximum.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-maximum.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-maximum.pbtxt index cc8218f7a..c87608ef5 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-maximum.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-maximum.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Maximum" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-minimum.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-minimum.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-minimum.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-minimum.pbtxt index 709c847a6..e9eab7fda 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-minimum.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-minimum.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Minimum" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-multi-head-attention.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-multi-head-attention.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-multi-head-attention.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-multi-head-attention.pbtxt index 4b8080a1b..4f4e7dddd 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-multi-head-attention.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-multi-head-attention.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.MultiHeadAttention" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-multiply.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-multiply.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-multiply.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-multiply.pbtxt index 3ef05dd00..865438c75 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-multiply.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-multiply.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Multiply" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-normalization.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-normalization.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-normalization.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-normalization.pbtxt index baa8fba13..f0dba4c51 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-normalization.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-normalization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Normalization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-p-re-l-u.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-p-re-l-u.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-p-re-l-u.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-p-re-l-u.pbtxt index 899af13f3..ceeaab91e 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-p-re-l-u.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-p-re-l-u.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.PReLU" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-permute.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-permute.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-permute.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-permute.pbtxt index e08c63815..e8c29bdbe 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-permute.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-permute.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Permute" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-r-n-n.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-r-n-n.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.layers.-r-n-n.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-r-n-n.pbtxt index 4dc7b8c60..21194235c 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-r-n-n.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-r-n-n.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.RNN" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-re-l-u.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-re-l-u.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-re-l-u.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-re-l-u.pbtxt index 831131154..4cf619fe1 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-re-l-u.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-re-l-u.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ReLU" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-repeat-vector.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-repeat-vector.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-repeat-vector.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-repeat-vector.pbtxt index a401a54ae..d289a93fb 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-repeat-vector.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-repeat-vector.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.RepeatVector" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-rescaling.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-rescaling.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-rescaling.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-rescaling.pbtxt index 2b52e5fa3..99ca24ded 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-rescaling.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-rescaling.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Rescaling" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-reshape.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-reshape.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-reshape.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-reshape.pbtxt index 8af2743e9..608c6a524 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-reshape.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-reshape.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Reshape" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-resizing.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-resizing.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-resizing.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-resizing.pbtxt index f04ecffd3..a5e0362a7 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-resizing.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-resizing.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Resizing" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-separable-conv1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-separable-conv1-d.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-separable-conv1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-separable-conv1-d.pbtxt index 6922c5910..56fc9e618 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-separable-conv1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-separable-conv1-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SeparableConv1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-separable-conv2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-separable-conv2-d.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-separable-conv2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-separable-conv2-d.pbtxt index b4d943239..e7ed3b8d8 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-separable-conv2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-separable-conv2-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SeparableConv2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-separable-convolution1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-separable-convolution1-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-separable-convolution1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-separable-convolution1-d.pbtxt index d21d6693b..6533cc3fa 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-separable-convolution1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-separable-convolution1-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SeparableConvolution1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-separable-convolution2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-separable-convolution2-d.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-separable-convolution2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-separable-convolution2-d.pbtxt index 312c27f69..cb53efb85 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-separable-convolution2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-separable-convolution2-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SeparableConvolution2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt index 20da793c2..15355a4dc 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SimpleRNNCell" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-simple-r-n-n.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-simple-r-n-n.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-simple-r-n-n.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-simple-r-n-n.pbtxt index 60a8f5172..48ffdd35c 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-simple-r-n-n.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-simple-r-n-n.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.SimpleRNN" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activation" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-softmax.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-softmax.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-softmax.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-softmax.pbtxt index e8e05a00e..bf209e5fd 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-softmax.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-softmax.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Softmax" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt index 0f926be02..7d69efc04 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SpatialDropout1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt index 1bb81438f..45a00b554 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SpatialDropout2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt index f31ec33f7..4ba331d14 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SpatialDropout3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt index 747de047f..bd1c7943a 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.StackedRNNCells" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-subtract.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-subtract.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-subtract.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-subtract.pbtxt index d6bba621d..75e8f476c 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-subtract.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-subtract.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Subtract" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt index 835f784b2..9438ede74 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ThresholdedReLU" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-time-distributed.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-time-distributed.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-time-distributed.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-time-distributed.pbtxt index 814d71686..d688747aa 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-time-distributed.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-time-distributed.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.TimeDistributed" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-up-sampling1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-up-sampling1-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-up-sampling1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-up-sampling1-d.pbtxt index ff61b890c..425cfb420 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-up-sampling1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-up-sampling1-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.UpSampling1D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-up-sampling2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-up-sampling2-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-up-sampling2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-up-sampling2-d.pbtxt index 383e28967..a9f9c4c58 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-up-sampling2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-up-sampling2-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.UpSampling2D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-up-sampling3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-up-sampling3-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-up-sampling3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-up-sampling3-d.pbtxt index b2a2d89c1..f446fdb9b 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-up-sampling3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-up-sampling3-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.UpSampling3D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-wrapper.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-wrapper.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-wrapper.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-wrapper.pbtxt index 149f9e616..201c09f6e 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-wrapper.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-wrapper.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Wrapper" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-zero-padding1-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-zero-padding1-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-zero-padding1-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-zero-padding1-d.pbtxt index 2ef8d53b6..41b0b95b7 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-zero-padding1-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-zero-padding1-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ZeroPadding1D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-zero-padding2-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-zero-padding2-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-zero-padding2-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-zero-padding2-d.pbtxt index 5f5c510ec..9862bb309 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-zero-padding2-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-zero-padding2-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ZeroPadding2D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-zero-padding3-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.-zero-padding3-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-zero-padding3-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.-zero-padding3-d.pbtxt index 03fc8519b..3051e3a0c 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-zero-padding3-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.-zero-padding3-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ZeroPadding3D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt index 0da8e034e..814e49b95 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.EinsumDense" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt index fb529f555..5cddc7fba 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.RandomFourierFeatures" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.experimental.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.layers.experimental.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt index a741778c7..9a3081c41 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.preprocessing.CategoryEncoding" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt index b2b7d584a..f472c16f5 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.preprocessing.CenterCrop" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt index f61c4f82c..2ca1cc8ea 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.preprocessing.Discretization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt index a608049a6..add667704 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.preprocessing.Hashing" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt index e6f797f63..5d0c878bf 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.preprocessing.Normalization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt index 942ce222c..5f2a971b0 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.preprocessing.PreprocessingLayer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt index fdbab2467..c41e5e8e0 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.preprocessing.Rescaling" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt index c11fb5969..b52a307cb 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.preprocessing.Resizing" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.layers.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.layers.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.layers.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.layers.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-binary-crossentropy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-binary-crossentropy.pbtxt similarity index 80% rename from keras/api/golden/v1/tensorflow.keras.losses.-binary-crossentropy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-binary-crossentropy.pbtxt index 9affaaf6e..098184bfd 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-binary-crossentropy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-binary-crossentropy.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.BinaryCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt similarity index 81% rename from keras/api/golden/v2/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt index ac49b8fc8..dd0eb62f9 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.BinaryFocalCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-categorical-crossentropy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-categorical-crossentropy.pbtxt similarity index 80% rename from keras/api/golden/v1/tensorflow.keras.losses.-categorical-crossentropy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-categorical-crossentropy.pbtxt index 7a50f8b0e..c74f381de 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-categorical-crossentropy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-categorical-crossentropy.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.CategoricalCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt similarity index 80% rename from keras/api/golden/v2/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt index f06b44ec8..ed5e93427 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.CategoricalFocalCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-categorical-hinge.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-categorical-hinge.pbtxt similarity index 78% rename from keras/api/golden/v2/tensorflow.keras.losses.-categorical-hinge.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-categorical-hinge.pbtxt index fc23af9c5..f26aa5fa3 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-categorical-hinge.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-categorical-hinge.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.CategoricalHinge" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-cosine-similarity.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-cosine-similarity.pbtxt similarity index 79% rename from keras/api/golden/v2/tensorflow.keras.losses.-cosine-similarity.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-cosine-similarity.pbtxt index 7bd4ab61c..8888b3554 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-cosine-similarity.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-cosine-similarity.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.CosineSimilarity" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-hinge.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-hinge.pbtxt similarity index 79% rename from keras/api/golden/v2/tensorflow.keras.losses.-hinge.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-hinge.pbtxt index a154c2a29..18bbfe822 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-hinge.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-hinge.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.Hinge" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-huber.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-huber.pbtxt similarity index 79% rename from keras/api/golden/v1/tensorflow.keras.losses.-huber.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-huber.pbtxt index b9da506b5..1ee7aa9b4 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-huber.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-huber.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.Huber" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-k-l-divergence.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-k-l-divergence.pbtxt similarity index 79% rename from keras/api/golden/v2/tensorflow.keras.losses.-k-l-divergence.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-k-l-divergence.pbtxt index b16a275a9..ab9e9523a 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-k-l-divergence.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-k-l-divergence.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.KLDivergence" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-log-cosh.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-log-cosh.pbtxt similarity index 79% rename from keras/api/golden/v1/tensorflow.keras.losses.-log-cosh.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-log-cosh.pbtxt index 97253a93e..e68b80633 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-log-cosh.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-log-cosh.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.LogCosh" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-loss.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-loss.pbtxt similarity index 92% rename from keras/api/golden/v1/tensorflow.keras.losses.-loss.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-loss.pbtxt index f6e062b14..8453fc3ed 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-loss.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-loss.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.losses.Loss" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-mean-absolute-error.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-mean-absolute-error.pbtxt similarity index 78% rename from keras/api/golden/v1/tensorflow.keras.losses.-mean-absolute-error.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-mean-absolute-error.pbtxt index 91dab6787..4bf4307fc 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-mean-absolute-error.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-mean-absolute-error.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.MeanAbsoluteError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt similarity index 78% rename from keras/api/golden/v1/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt index f4c1b5cf0..8d7634ef6 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.MeanAbsolutePercentageError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-mean-squared-error.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-mean-squared-error.pbtxt similarity index 78% rename from keras/api/golden/v1/tensorflow.keras.losses.-mean-squared-error.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-mean-squared-error.pbtxt index 815bddaf3..2f1caf77b 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-mean-squared-error.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-mean-squared-error.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.MeanSquaredError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt similarity index 78% rename from keras/api/golden/v1/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt index d08388055..ade043a0b 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.MeanSquaredLogarithmicError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-poisson.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-poisson.pbtxt similarity index 79% rename from keras/api/golden/v2/tensorflow.keras.losses.-poisson.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-poisson.pbtxt index 5313398aa..5e29b0542 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-poisson.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-poisson.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.Poisson" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt similarity index 79% rename from keras/api/golden/v1/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt index 389b05c75..ab33022ab 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.SparseCategoricalCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-squared-hinge.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.-squared-hinge.pbtxt similarity index 79% rename from keras/api/golden/v1/tensorflow.keras.losses.-squared-hinge.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.-squared-hinge.pbtxt index 3f2cf2c5b..33e70ce25 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-squared-hinge.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.losses.-squared-hinge.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.SquaredHinge" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.losses.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.losses.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.losses.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-a-u-c.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-a-u-c.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.metrics.-a-u-c.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-a-u-c.pbtxt index 171da23f3..ffd4b2c07 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-a-u-c.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-a-u-c.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.metrics.AUC" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-accuracy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-accuracy.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-accuracy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-accuracy.pbtxt index 863b94844..a67b0a670 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-accuracy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-accuracy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.Accuracy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-binary-accuracy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-binary-accuracy.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-binary-accuracy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-binary-accuracy.pbtxt index 4b8759cf7..fcc6c6266 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-binary-accuracy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-binary-accuracy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.BinaryAccuracy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-binary-crossentropy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-binary-crossentropy.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-binary-crossentropy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-binary-crossentropy.pbtxt index 16228d422..afcbda97b 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-binary-crossentropy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-binary-crossentropy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.BinaryCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-binary-io-u.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-binary-io-u.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.metrics.-binary-io-u.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-binary-io-u.pbtxt index 49e4ac294..1e92917c6 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-binary-io-u.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-binary-io-u.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.metrics.BinaryIoU" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-categorical-accuracy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-categorical-accuracy.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-categorical-accuracy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-categorical-accuracy.pbtxt index c56abceae..cb797237b 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-categorical-accuracy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-categorical-accuracy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.CategoricalAccuracy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt index 92d50ec7a..d4aaa3c26 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.CategoricalCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-categorical-hinge.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-categorical-hinge.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-categorical-hinge.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-categorical-hinge.pbtxt index f4386171e..42c091336 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-categorical-hinge.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-categorical-hinge.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.CategoricalHinge" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-cosine-similarity.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-cosine-similarity.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-cosine-similarity.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-cosine-similarity.pbtxt index 221cbe34e..f6e28154c 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-cosine-similarity.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-cosine-similarity.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.CosineSimilarity" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-f-beta-score.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-f-beta-score.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.metrics.-f-beta-score.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-f-beta-score.pbtxt index 37847a1f9..61da1faa4 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-f-beta-score.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-f-beta-score.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.metrics.FBetaScore" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-f1-score.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-f1-score.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.metrics.-f1-score.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-f1-score.pbtxt index 56d233b0b..9ff9cb994 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-f1-score.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-f1-score.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.F1Score" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-false-negatives.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-false-negatives.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.metrics.-false-negatives.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-false-negatives.pbtxt index 12518c046..b5e002f3b 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-false-negatives.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-false-negatives.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.FalseNegatives" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-false-positives.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-false-positives.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.metrics.-false-positives.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-false-positives.pbtxt index d3a260bc7..38058d627 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-false-positives.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-false-positives.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.FalsePositives" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-hinge.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-hinge.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-hinge.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-hinge.pbtxt index c01adca8b..ffbcc6071 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-hinge.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-hinge.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.Hinge" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-io-u.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-io-u.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.metrics.-io-u.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-io-u.pbtxt index 3b3e4ed1e..ce2e9a70d 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-io-u.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-io-u.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.IoU" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-k-l-divergence.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-k-l-divergence.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-k-l-divergence.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-k-l-divergence.pbtxt index 8fe4028c9..51cdf17c7 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-k-l-divergence.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-k-l-divergence.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.KLDivergence" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-log-cosh-error.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-log-cosh-error.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-log-cosh-error.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-log-cosh-error.pbtxt index 862a2c127..3cf72f342 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-log-cosh-error.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-log-cosh-error.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.LogCoshError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-absolute-error.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-absolute-error.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-mean-absolute-error.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-absolute-error.pbtxt index 4db047358..db467fab9 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-absolute-error.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-absolute-error.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.MeanAbsoluteError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt index c1a4285ba..46c80dc84 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.MeanAbsolutePercentageError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-io-u.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-io-u.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.metrics.-mean-io-u.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-io-u.pbtxt index eb8b2c471..1ebbb6303 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-io-u.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-io-u.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.metrics.MeanIoU" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt index d84345e14..597cd1311 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.metrics.MeanMetricWrapper" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-relative-error.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-relative-error.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.metrics.-mean-relative-error.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-relative-error.pbtxt index 697c4e0bb..c2c475ab0 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-relative-error.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-relative-error.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.metrics.MeanRelativeError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-squared-error.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-squared-error.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-mean-squared-error.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-squared-error.pbtxt index ceb5282f0..1b39d9002 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-squared-error.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-squared-error.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.MeanSquaredError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt index 2d5cf64c2..d10df5da4 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.MeanSquaredLogarithmicError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-tensor.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-tensor.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.metrics.-mean-tensor.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-tensor.pbtxt index 6e8ba1767..eef3b0c26 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-tensor.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean-tensor.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.metrics.MeanTensor" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-mean.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.metrics.-mean.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean.pbtxt index c31d49e14..859bf2b08 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-mean.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-mean.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.Mean" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-metric.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-metric.pbtxt similarity index 97% rename from keras/api/golden/v2/tensorflow.keras.metrics.-metric.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-metric.pbtxt index 916ae9309..e85091fa6 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-metric.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-metric.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.metrics.Metric" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-one-hot-io-u.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-one-hot-io-u.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.metrics.-one-hot-io-u.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-one-hot-io-u.pbtxt index 23fd50224..bbe5bf507 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-one-hot-io-u.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-one-hot-io-u.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.metrics.OneHotIoU" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt index 98b63a62d..e178faa65 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.OneHotMeanIoU" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-poisson.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-poisson.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-poisson.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-poisson.pbtxt index 1d5f8c6ef..8ab8967a9 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-poisson.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-poisson.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.Poisson" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-precision-at-recall.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-precision-at-recall.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.metrics.-precision-at-recall.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-precision-at-recall.pbtxt index 21f1c36bd..1490978f2 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-precision-at-recall.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-precision-at-recall.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.PrecisionAtRecall" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-precision.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-precision.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.metrics.-precision.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-precision.pbtxt index d9c49540e..297fc2cec 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-precision.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-precision.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.metrics.Precision" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-r2-score.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-r2-score.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.metrics.-r2-score.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-r2-score.pbtxt index 1e76ffb29..335d51a1a 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-r2-score.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-r2-score.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.metrics.R2Score" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-recall-at-precision.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-recall-at-precision.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.metrics.-recall-at-precision.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-recall-at-precision.pbtxt index 5aa668718..2a1885cba 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-recall-at-precision.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-recall-at-precision.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.RecallAtPrecision" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-recall.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-recall.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.metrics.-recall.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-recall.pbtxt index e7c4864a1..4785c25a2 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-recall.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-recall.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.metrics.Recall" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt index 64671f63b..e7465f8d4 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.metrics.RootMeanSquaredError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt index 9b35e4f14..ca3983ff4 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.SensitivityAtSpecificity" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt index d960b99ec..05e7584c2 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.SparseCategoricalAccuracy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt index c5bd4c6f5..5ab16ab8c 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.SparseCategoricalCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt index 069a3e3b2..6eb2c4593 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.SparseTopKCategoricalAccuracy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt index 9f42d1f0b..9bc6e71b3 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.SpecificityAtSensitivity" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-squared-hinge.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-squared-hinge.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-squared-hinge.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-squared-hinge.pbtxt index 83437f332..42b20dbd3 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-squared-hinge.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-squared-hinge.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.SquaredHinge" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-sum.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-sum.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.metrics.-sum.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-sum.pbtxt index 6cb46d1f9..1dacac458 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-sum.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-sum.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.Sum" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt index 6355e88e1..060258cc3 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.TopKCategoricalAccuracy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-true-negatives.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-true-negatives.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.metrics.-true-negatives.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-true-negatives.pbtxt index 95bc523ab..b3e3eb95a 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-true-negatives.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-true-negatives.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.TrueNegatives" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-true-positives.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-true-positives.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.metrics.-true-positives.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.-true-positives.pbtxt index 863fb2911..7830f1dac 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-true-positives.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.metrics.-true-positives.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.TruePositives" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.metrics.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.metrics.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.metrics.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt similarity index 89% rename from keras/api/golden/v1/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt index 50931ad79..3795f2294 100644 --- a/keras/api/golden/v1/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.mixed_precision.LossScaleOptimizer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member { name: "dynamic" diff --git a/keras/api/golden/v1/tensorflow.keras.mixed_precision.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.mixed_precision.pbtxt similarity index 50% rename from keras/api/golden/v1/tensorflow.keras.mixed_precision.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.mixed_precision.pbtxt index 162551519..30629bfe6 100644 --- a/keras/api/golden/v1/tensorflow.keras.mixed_precision.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.mixed_precision.pbtxt @@ -2,6 +2,6 @@ path: "tensorflow.keras.mixed_precision" tf_module { member { name: "LossScaleOptimizer" - mtype: "" + mtype: "" } } diff --git a/keras/api/golden/v1/tensorflow.keras.models.-linear-model.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.models.-linear-model.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.models.-linear-model.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.models.-linear-model.pbtxt index a7e40b8a1..98c697ec7 100644 --- a/keras/api/golden/v1/tensorflow.keras.models.-linear-model.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.models.-linear-model.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.models.LinearModel" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.models.-model.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.models.-model.pbtxt similarity index 98% rename from keras/api/golden/v2/tensorflow.keras.models.-model.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.models.-model.pbtxt index af5a892ca..beea74ace 100644 --- a/keras/api/golden/v2/tensorflow.keras.models.-model.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.models.-model.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.models.Model" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.models.-sequential.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.models.-sequential.pbtxt similarity index 97% rename from keras/api/golden/v2/tensorflow.keras.models.-sequential.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.models.-sequential.pbtxt index a6f046c2e..49d4a9a43 100644 --- a/keras/api/golden/v2/tensorflow.keras.models.-sequential.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.models.-sequential.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.models.Sequential" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.models.-wide-deep-model.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.models.-wide-deep-model.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.models.-wide-deep-model.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.models.-wide-deep-model.pbtxt index ee3b09f7c..7fbfd0d8f 100644 --- a/keras/api/golden/v1/tensorflow.keras.models.-wide-deep-model.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.models.-wide-deep-model.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.models.WideDeepModel" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.models.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.models.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.models.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.models.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.-adadelta.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-adadelta.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.optimizers.-adadelta.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.-adadelta.pbtxt index ff4531cd4..8a8b5997c 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.-adadelta.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-adadelta.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.Adadelta" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.-adagrad.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-adagrad.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.optimizers.-adagrad.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.-adagrad.pbtxt index 4e35fed07..f1488acb0 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.-adagrad.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-adagrad.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.Adagrad" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.-adam.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-adam.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.optimizers.-adam.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.-adam.pbtxt index 697ca03f6..3cf9396b5 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.-adam.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-adam.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.Adam" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.-adamax.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-adamax.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.optimizers.-adamax.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.-adamax.pbtxt index c488d88b7..a576be423 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.-adamax.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-adamax.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.Adamax" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.-ftrl.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-ftrl.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.optimizers.-ftrl.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.-ftrl.pbtxt index e75a11b74..9f68c0f08 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.-ftrl.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-ftrl.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.Ftrl" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.-nadam.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-nadam.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.optimizers.-nadam.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.-nadam.pbtxt index a09e7ac9a..5763a05e7 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.-nadam.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-nadam.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.Nadam" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.-optimizer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-optimizer.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.optimizers.-optimizer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.-optimizer.pbtxt index 43c247557..9094a6346 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.-optimizer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-optimizer.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.optimizers.Optimizer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.-r-m-sprop.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-r-m-sprop.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.optimizers.-r-m-sprop.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.-r-m-sprop.pbtxt index 8b093190f..4cf23e1cc 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.-r-m-sprop.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-r-m-sprop.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.RMSprop" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.-s-g-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-s-g-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.optimizers.-s-g-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.-s-g-d.pbtxt index 78fdecf4d..22c7c1a31 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.-s-g-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.-s-g-d.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.SGD" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt index 05ae2888d..528567153 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.Adadelta" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt index 507148f08..d4fb50974 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.Adagrad" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adam.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adam.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adam.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adam.pbtxt index d79093442..07917a64c 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adam.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adam.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.Adam" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adamax.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adamax.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adamax.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adamax.pbtxt index b18db0316..226f97c05 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adamax.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adamax.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.Adamax" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt index b852c98df..44dafcb30 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.Ftrl" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-nadam.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-nadam.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-nadam.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-nadam.pbtxt index ef505faad..3e579154c 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-nadam.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-nadam.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.Nadam" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt similarity index 97% rename from keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt index f28c01037..de3e1f12a 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.optimizers.legacy.Optimizer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt index f53b0568f..0c274c7ee 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.RMSprop" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt index ab1041592..b525c6540 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.SGD" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.optimizers.legacy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.legacy.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.optimizers.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt similarity index 74% rename from keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt index 16daa97b8..ce4fdbf11 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.schedules.CosineDecayRestarts" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt similarity index 75% rename from keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt index 6df561f33..b89865e52 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.schedules.CosineDecay" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt similarity index 74% rename from keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt index c38633e5a..07cf7a115 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.schedules.ExponentialDecay" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt similarity index 74% rename from keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt index 56f6937bb..25c40c9a9 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.schedules.InverseTimeDecay" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt similarity index 79% rename from keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt index 243f00aba..cee3d2373 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.optimizers.schedules.LearningRateSchedule" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt similarity index 71% rename from keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt index f5ceeb326..a611f2d84 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.schedules.PiecewiseConstantDecay" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt similarity index 75% rename from keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt index fb2000072..a50220198 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.schedules.PolynomialDecay" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.optimizers.schedules.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.optimizers.schedules.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt similarity index 85% rename from keras/api/golden/v2/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt index e584a165e..291061dd5 100644 --- a/keras/api/golden/v2/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt @@ -1,9 +1,9 @@ path: "tensorflow.keras.preprocessing.image.DirectoryIterator" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "allowed_class_modes" diff --git a/keras/api/golden/v1/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt index 200135f90..0f26fdc80 100644 --- a/keras/api/golden/v1/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.preprocessing.image.ImageDataGenerator" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.preprocessing.image.-iterator.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.-iterator.pbtxt similarity index 84% rename from keras/api/golden/v1/tensorflow.keras.preprocessing.image.-iterator.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.-iterator.pbtxt index 94b1da3b7..ec3738727 100644 --- a/keras/api/golden/v1/tensorflow.keras.preprocessing.image.-iterator.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.-iterator.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.preprocessing.image.Iterator" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "white_list_formats" diff --git a/keras/api/golden/v2/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt similarity index 82% rename from keras/api/golden/v2/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt index c5dbf052f..e5761898c 100644 --- a/keras/api/golden/v2/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.preprocessing.image.NumpyArrayIterator" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "white_list_formats" diff --git a/keras/api/golden/v1/tensorflow.keras.preprocessing.image.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.preprocessing.image.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.preprocessing.image.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.preprocessing.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.preprocessing.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.preprocessing.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt similarity index 84% rename from keras/api/golden/v1/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt index 1e99d483a..e5361134c 100644 --- a/keras/api/golden/v1/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.preprocessing.sequence.TimeseriesGenerator" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.preprocessing.sequence.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.sequence.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.preprocessing.sequence.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.preprocessing.sequence.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt index 2e841daf0..a2c0ac766 100644 --- a/keras/api/golden/v2/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.preprocessing.text.Tokenizer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.preprocessing.text.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.preprocessing.text.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.preprocessing.text.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.preprocessing.text.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.regularizers.-l1-l2.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.regularizers.-l1-l2.pbtxt similarity index 80% rename from keras/api/golden/v1/tensorflow.keras.regularizers.-l1-l2.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.regularizers.-l1-l2.pbtxt index b704de99c..6cd4521da 100644 --- a/keras/api/golden/v1/tensorflow.keras.regularizers.-l1-l2.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.regularizers.-l1-l2.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.regularizers.L1L2" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.regularizers.-l1.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.regularizers.-l1.pbtxt similarity index 80% rename from keras/api/golden/v1/tensorflow.keras.regularizers.-l1.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.regularizers.-l1.pbtxt index 31d5659bd..f5fa8ad43 100644 --- a/keras/api/golden/v1/tensorflow.keras.regularizers.-l1.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.regularizers.-l1.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.regularizers.L1" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.regularizers.-l2.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.regularizers.-l2.pbtxt similarity index 80% rename from keras/api/golden/v2/tensorflow.keras.regularizers.-l2.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.regularizers.-l2.pbtxt index 5253aec0f..ef26014de 100644 --- a/keras/api/golden/v2/tensorflow.keras.regularizers.-l2.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.regularizers.-l2.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.regularizers.L2" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.regularizers.-regularizer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.regularizers.-regularizer.pbtxt similarity index 86% rename from keras/api/golden/v1/tensorflow.keras.regularizers.-regularizer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.regularizers.-regularizer.pbtxt index 4a7bbb34f..ac794f9e9 100644 --- a/keras/api/golden/v1/tensorflow.keras.regularizers.-regularizer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.regularizers.-regularizer.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.regularizers.Regularizer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.regularizers.l1.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.regularizers.l1.pbtxt similarity index 80% rename from keras/api/golden/v1/tensorflow.keras.regularizers.l1.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.regularizers.l1.pbtxt index b3c5b3dfd..6587f26d2 100644 --- a/keras/api/golden/v1/tensorflow.keras.regularizers.l1.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.regularizers.l1.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.regularizers.l1" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.regularizers.l2.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.regularizers.l2.pbtxt similarity index 80% rename from keras/api/golden/v2/tensorflow.keras.regularizers.l2.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.regularizers.l2.pbtxt index 4db49bd44..d32de838e 100644 --- a/keras/api/golden/v2/tensorflow.keras.regularizers.l2.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.regularizers.l2.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.regularizers.l2" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.regularizers.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.regularizers.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.regularizers.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.regularizers.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.saving.custom_object_scope.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.saving.custom_object_scope.pbtxt similarity index 72% rename from keras/api/golden/v2/tensorflow.keras.saving.custom_object_scope.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.saving.custom_object_scope.pbtxt index cf877e5ae..c03beb677 100644 --- a/keras/api/golden/v2/tensorflow.keras.saving.custom_object_scope.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.saving.custom_object_scope.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.saving.custom_object_scope" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.saving.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.saving.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.saving.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.saving.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.utils.-custom-object-scope.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.utils.-custom-object-scope.pbtxt similarity index 72% rename from keras/api/golden/v2/tensorflow.keras.utils.-custom-object-scope.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.utils.-custom-object-scope.pbtxt index 3ccf719d8..f88357a3e 100644 --- a/keras/api/golden/v2/tensorflow.keras.utils.-custom-object-scope.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.utils.-custom-object-scope.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.CustomObjectScope" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.utils.-deterministic-random-test-tool.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.utils.-deterministic-random-test-tool.pbtxt similarity index 82% rename from keras/api/golden/v1/tensorflow.keras.utils.-deterministic-random-test-tool.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.utils.-deterministic-random-test-tool.pbtxt index fefb0a276..318b71d31 100644 --- a/keras/api/golden/v1/tensorflow.keras.utils.-deterministic-random-test-tool.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.utils.-deterministic-random-test-tool.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.DeterministicRandomTestTool" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member { name: "operation_seed" diff --git a/keras/api/golden/v1/tensorflow.keras.utils.-generator-enqueuer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.utils.-generator-enqueuer.pbtxt similarity index 84% rename from keras/api/golden/v1/tensorflow.keras.utils.-generator-enqueuer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.utils.-generator-enqueuer.pbtxt index ac1c5387b..e244c5b25 100644 --- a/keras/api/golden/v1/tensorflow.keras.utils.-generator-enqueuer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.utils.-generator-enqueuer.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.utils.GeneratorEnqueuer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.utils.-ordered-enqueuer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.utils.-ordered-enqueuer.pbtxt similarity index 85% rename from keras/api/golden/v2/tensorflow.keras.utils.-ordered-enqueuer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.utils.-ordered-enqueuer.pbtxt index 9cd4b730b..d93a85d10 100644 --- a/keras/api/golden/v2/tensorflow.keras.utils.-ordered-enqueuer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.utils.-ordered-enqueuer.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.utils.OrderedEnqueuer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.utils.-progbar.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.utils.-progbar.pbtxt similarity index 90% rename from keras/api/golden/v1/tensorflow.keras.utils.-progbar.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.utils.-progbar.pbtxt index a1b31c038..291771d17 100644 --- a/keras/api/golden/v1/tensorflow.keras.utils.-progbar.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.utils.-progbar.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.Progbar" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.utils.-sequence-enqueuer.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.utils.-sequence-enqueuer.pbtxt similarity index 91% rename from keras/api/golden/v1/tensorflow.keras.utils.-sequence-enqueuer.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.utils.-sequence-enqueuer.pbtxt index eb3bbc5b8..62980ea43 100644 --- a/keras/api/golden/v1/tensorflow.keras.utils.-sequence-enqueuer.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.utils.-sequence-enqueuer.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.SequenceEnqueuer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.utils.-sequence.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.utils.-sequence.pbtxt similarity index 79% rename from keras/api/golden/v2/tensorflow.keras.utils.-sequence.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.utils.-sequence.pbtxt index 43e0717cc..498848d25 100644 --- a/keras/api/golden/v2/tensorflow.keras.utils.-sequence.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.utils.-sequence.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.Sequence" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt similarity index 87% rename from keras/api/golden/v2/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt index 1363d2190..8f330282b 100644 --- a/keras/api/golden/v2/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.StepsPerExecutionTuner" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member { name: "steps_per_execution" diff --git a/keras/api/golden/v2/tensorflow.keras.utils.custom_object_scope.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.utils.custom_object_scope.pbtxt similarity index 72% rename from keras/api/golden/v2/tensorflow.keras.utils.custom_object_scope.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.utils.custom_object_scope.pbtxt index 08f84e0f8..4867aa1ae 100644 --- a/keras/api/golden/v2/tensorflow.keras.utils.custom_object_scope.pbtxt +++ b/tf_keras/api/golden/v1/tensorflow.keras.utils.custom_object_scope.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.custom_object_scope" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.utils.legacy.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.utils.legacy.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.utils.legacy.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.utils.legacy.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.utils.pbtxt b/tf_keras/api/golden/v1/tensorflow.keras.utils.pbtxt similarity index 100% rename from keras/api/golden/v1/tensorflow.keras.utils.pbtxt rename to tf_keras/api/golden/v1/tensorflow.keras.utils.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.-model.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.-model.pbtxt similarity index 98% rename from keras/api/golden/v2/tensorflow.keras.-model.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.-model.pbtxt index a867fb43e..12410a461 100644 --- a/keras/api/golden/v2/tensorflow.keras.-model.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.-model.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.Model" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.-sequential.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.-sequential.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.-sequential.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.-sequential.pbtxt index fc9edeb88..da0ee6c22 100644 --- a/keras/api/golden/v1/tensorflow.keras.-sequential.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.-sequential.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.Sequential" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.__internal__.-keras-tensor.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.-keras-tensor.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.__internal__.-keras-tensor.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.__internal__.-keras-tensor.pbtxt index 9b09b44a8..ddae1e040 100644 --- a/keras/api/golden/v2/tensorflow.keras.__internal__.-keras-tensor.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.-keras-tensor.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.__internal__.KerasTensor" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member { name: "dtype" diff --git a/keras/api/golden/v2/tensorflow.keras.__internal__.-ragged-keras-tensor.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.-ragged-keras-tensor.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.__internal__.-ragged-keras-tensor.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.__internal__.-ragged-keras-tensor.pbtxt index 7c91676b2..76d210f5e 100644 --- a/keras/api/golden/v2/tensorflow.keras.__internal__.-ragged-keras-tensor.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.-ragged-keras-tensor.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.__internal__.RaggedKerasTensor" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "dtype" diff --git a/keras/api/golden/v2/tensorflow.keras.__internal__.-sparse-keras-tensor.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.-sparse-keras-tensor.pbtxt similarity index 92% rename from keras/api/golden/v2/tensorflow.keras.__internal__.-sparse-keras-tensor.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.__internal__.-sparse-keras-tensor.pbtxt index c25a8784d..09e0fd6af 100644 --- a/keras/api/golden/v2/tensorflow.keras.__internal__.-sparse-keras-tensor.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.-sparse-keras-tensor.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.__internal__.SparseKerasTensor" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "dense_shape" diff --git a/keras/api/golden/v2/tensorflow.keras.__internal__.backend.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.backend.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.__internal__.backend.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.__internal__.backend.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.__internal__.layers.-base-dense-attention.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.layers.-base-dense-attention.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.__internal__.layers.-base-dense-attention.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.__internal__.layers.-base-dense-attention.pbtxt index bb4b16600..30ab196eb 100644 --- a/keras/api/golden/v2/tensorflow.keras.__internal__.layers.-base-dense-attention.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.layers.-base-dense-attention.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.__internal__.layers.BaseDenseAttention" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt index 68aa8fd65..18d445e48 100644 --- a/keras/api/golden/v2/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.layers.-base-random-layer.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.__internal__.layers.BaseRandomLayer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.__internal__.layers.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.layers.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.__internal__.layers.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.__internal__.layers.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.__internal__.losses.-loss-function-wrapper.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.losses.-loss-function-wrapper.pbtxt similarity index 85% rename from keras/api/golden/v2/tensorflow.keras.__internal__.losses.-loss-function-wrapper.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.__internal__.losses.-loss-function-wrapper.pbtxt index b59c57da8..8edf9b4ee 100644 --- a/keras/api/golden/v2/tensorflow.keras.__internal__.losses.-loss-function-wrapper.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.losses.-loss-function-wrapper.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.__internal__.losses.LossFunctionWrapper" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.__internal__.losses.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.losses.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.__internal__.losses.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.__internal__.losses.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.__internal__.models.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.models.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.__internal__.models.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.__internal__.models.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.__internal__.optimizers.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.optimizers.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.__internal__.optimizers.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.__internal__.optimizers.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.__internal__.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.__internal__.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.__internal__.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.__internal__.utils.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.__internal__.utils.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.__internal__.utils.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.__internal__.utils.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.activations.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.activations.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.activations.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.activations.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.convnext.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.convnext.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.convnext.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.convnext.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.densenet.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.densenet.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.densenet.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.densenet.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.efficientnet.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.efficientnet.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.efficientnet.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.efficientnet.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.efficientnet_v2.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.efficientnet_v2.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.efficientnet_v2.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.efficientnet_v2.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.imagenet_utils.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.imagenet_utils.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.imagenet_utils.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.imagenet_utils.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.inception_resnet_v2.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.inception_resnet_v2.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.inception_resnet_v2.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.inception_resnet_v2.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.inception_v3.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.inception_v3.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.inception_v3.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.inception_v3.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.mobilenet.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.mobilenet.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.mobilenet.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.mobilenet.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.mobilenet_v2.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.mobilenet_v2.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.mobilenet_v2.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.mobilenet_v2.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.mobilenet_v3.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.mobilenet_v3.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.mobilenet_v3.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.mobilenet_v3.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.nasnet.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.nasnet.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.nasnet.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.nasnet.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.regnet.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.regnet.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.regnet.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.regnet.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.resnet.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.resnet.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.resnet.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.resnet.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.resnet50.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.resnet50.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.resnet50.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.resnet50.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.resnet_rs.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.resnet_rs.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.resnet_rs.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.resnet_rs.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.resnet_v2.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.resnet_v2.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.resnet_v2.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.resnet_v2.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.vgg16.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.vgg16.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.vgg16.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.vgg16.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.vgg19.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.vgg19.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.vgg19.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.vgg19.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.applications.xception.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.applications.xception.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.applications.xception.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.applications.xception.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.backend.experimental.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.backend.experimental.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.backend.experimental.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.backend.experimental.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.backend.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.backend.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.backend.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.backend.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-backup-and-restore.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-backup-and-restore.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-backup-and-restore.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-backup-and-restore.pbtxt index ea38be4ad..f4db999db 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-backup-and-restore.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-backup-and-restore.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.BackupAndRestore" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-base-logger.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-base-logger.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-base-logger.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-base-logger.pbtxt index 3a8597db7..4f48ea20a 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-base-logger.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-base-logger.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.BaseLogger" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt index fbeada729..33698bcd0 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-c-s-v-logger.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.CSVLogger" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-callback-list.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-callback-list.pbtxt similarity index 98% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-callback-list.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-callback-list.pbtxt index d3b5171b2..e9c305646 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-callback-list.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-callback-list.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.callbacks.CallbackList" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-callback.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-callback.pbtxt similarity index 98% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-callback.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-callback.pbtxt index faa4541b7..c39ad8fc2 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-callback.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-callback.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.callbacks.Callback" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-early-stopping.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-early-stopping.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-early-stopping.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-early-stopping.pbtxt index 2f6f3059b..93c18f904 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-early-stopping.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-early-stopping.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.EarlyStopping" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-history.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-history.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-history.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-history.pbtxt index 379a9f3aa..24e8c189f 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-history.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-history.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.History" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-lambda-callback.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-lambda-callback.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-lambda-callback.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-lambda-callback.pbtxt index 61c47980e..b4ee05a7f 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-lambda-callback.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-lambda-callback.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.LambdaCallback" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt index 02a8faf67..6024f4aff 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-learning-rate-scheduler.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.LearningRateScheduler" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-model-checkpoint.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-model-checkpoint.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-model-checkpoint.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-model-checkpoint.pbtxt index e13044336..0dd015ba6 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-model-checkpoint.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-model-checkpoint.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.ModelCheckpoint" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-progbar-logger.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-progbar-logger.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-progbar-logger.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-progbar-logger.pbtxt index e8f92604b..c5bf280ed 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-progbar-logger.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-progbar-logger.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.ProgbarLogger" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt index a7792b964..c753fc75e 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-reduce-l-r-on-plateau.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.ReduceLROnPlateau" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-remote-monitor.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-remote-monitor.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-remote-monitor.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-remote-monitor.pbtxt index 98552f19d..e1da16a95 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-remote-monitor.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-remote-monitor.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.RemoteMonitor" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt index 0a33bbb4e..edc7755a1 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-sidecar-evaluator-model-export.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.callbacks.SidecarEvaluatorModelExport" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.-tensor-board.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-tensor-board.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.callbacks.-tensor-board.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-tensor-board.pbtxt index afde757a3..5e0bbad61 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.-tensor-board.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-tensor-board.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.callbacks.TensorBoard" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt index 62ccd1ec2..bb72b7127 100644 --- a/keras/api/golden/v1/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.-terminate-on-na-n.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.callbacks.TerminateOnNaN" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.experimental.-backup-and-restore.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.experimental.-backup-and-restore.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.callbacks.experimental.-backup-and-restore.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.experimental.-backup-and-restore.pbtxt index d7b57d50a..0a682199f 100644 --- a/keras/api/golden/v2/tensorflow.keras.callbacks.experimental.-backup-and-restore.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.experimental.-backup-and-restore.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.callbacks.experimental.BackupAndRestore" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.experimental.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.experimental.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.callbacks.experimental.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.experimental.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.callbacks.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.callbacks.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.callbacks.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.callbacks.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.constraints.-constraint.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.constraints.-constraint.pbtxt similarity index 86% rename from keras/api/golden/v1/tensorflow.keras.constraints.-constraint.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.constraints.-constraint.pbtxt index ebce5a630..326d23164 100644 --- a/keras/api/golden/v1/tensorflow.keras.constraints.-constraint.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.constraints.-constraint.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.constraints.Constraint" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.constraints.-max-norm.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.constraints.-max-norm.pbtxt similarity index 80% rename from keras/api/golden/v1/tensorflow.keras.constraints.-max-norm.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.constraints.-max-norm.pbtxt index 751357a36..5173b8775 100644 --- a/keras/api/golden/v1/tensorflow.keras.constraints.-max-norm.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.constraints.-max-norm.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.MaxNorm" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.constraints.-min-max-norm.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.constraints.-min-max-norm.pbtxt similarity index 81% rename from keras/api/golden/v1/tensorflow.keras.constraints.-min-max-norm.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.constraints.-min-max-norm.pbtxt index f385c813c..fac9eb7fe 100644 --- a/keras/api/golden/v1/tensorflow.keras.constraints.-min-max-norm.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.constraints.-min-max-norm.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.MinMaxNorm" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.constraints.-non-neg.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.constraints.-non-neg.pbtxt similarity index 76% rename from keras/api/golden/v2/tensorflow.keras.constraints.-non-neg.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.constraints.-non-neg.pbtxt index ab3251209..7cf8702d3 100644 --- a/keras/api/golden/v2/tensorflow.keras.constraints.-non-neg.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.constraints.-non-neg.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.NonNeg" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.constraints.-radial-constraint.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.constraints.-radial-constraint.pbtxt similarity index 75% rename from keras/api/golden/v1/tensorflow.keras.constraints.-radial-constraint.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.constraints.-radial-constraint.pbtxt index 54e6adf3e..b476ee545 100644 --- a/keras/api/golden/v1/tensorflow.keras.constraints.-radial-constraint.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.constraints.-radial-constraint.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.RadialConstraint" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.constraints.-unit-norm.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.constraints.-unit-norm.pbtxt similarity index 79% rename from keras/api/golden/v1/tensorflow.keras.constraints.-unit-norm.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.constraints.-unit-norm.pbtxt index b821bbb8a..402057a15 100644 --- a/keras/api/golden/v1/tensorflow.keras.constraints.-unit-norm.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.constraints.-unit-norm.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.UnitNorm" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.constraints.max_norm.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.constraints.max_norm.pbtxt similarity index 80% rename from keras/api/golden/v2/tensorflow.keras.constraints.max_norm.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.constraints.max_norm.pbtxt index 42aeaf7e0..e46433861 100644 --- a/keras/api/golden/v2/tensorflow.keras.constraints.max_norm.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.constraints.max_norm.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.max_norm" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.constraints.min_max_norm.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.constraints.min_max_norm.pbtxt similarity index 81% rename from keras/api/golden/v2/tensorflow.keras.constraints.min_max_norm.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.constraints.min_max_norm.pbtxt index 47ab0d110..9efd9bea0 100644 --- a/keras/api/golden/v2/tensorflow.keras.constraints.min_max_norm.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.constraints.min_max_norm.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.min_max_norm" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.constraints.non_neg.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.constraints.non_neg.pbtxt similarity index 76% rename from keras/api/golden/v1/tensorflow.keras.constraints.non_neg.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.constraints.non_neg.pbtxt index 0a8c23153..aaeedf64c 100644 --- a/keras/api/golden/v1/tensorflow.keras.constraints.non_neg.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.constraints.non_neg.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.non_neg" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.constraints.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.constraints.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.constraints.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.constraints.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.constraints.radial_constraint.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.constraints.radial_constraint.pbtxt similarity index 75% rename from keras/api/golden/v2/tensorflow.keras.constraints.radial_constraint.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.constraints.radial_constraint.pbtxt index 78d401b28..e148bc564 100644 --- a/keras/api/golden/v2/tensorflow.keras.constraints.radial_constraint.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.constraints.radial_constraint.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.radial_constraint" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.constraints.unit_norm.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.constraints.unit_norm.pbtxt similarity index 80% rename from keras/api/golden/v2/tensorflow.keras.constraints.unit_norm.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.constraints.unit_norm.pbtxt index 137cb505e..9a32c6232 100644 --- a/keras/api/golden/v2/tensorflow.keras.constraints.unit_norm.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.constraints.unit_norm.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.constraints.unit_norm" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.datasets.boston_housing.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.datasets.boston_housing.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.datasets.boston_housing.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.datasets.boston_housing.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.datasets.cifar10.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.datasets.cifar10.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.datasets.cifar10.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.datasets.cifar10.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.datasets.cifar100.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.datasets.cifar100.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.datasets.cifar100.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.datasets.cifar100.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.datasets.fashion_mnist.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.datasets.fashion_mnist.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.datasets.fashion_mnist.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.datasets.fashion_mnist.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.datasets.imdb.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.datasets.imdb.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.datasets.imdb.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.datasets.imdb.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.datasets.mnist.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.datasets.mnist.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.datasets.mnist.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.datasets.mnist.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.datasets.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.datasets.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.datasets.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.datasets.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.datasets.reuters.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.datasets.reuters.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.datasets.reuters.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.datasets.reuters.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.-layout-map.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.-layout-map.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.dtensor.experimental.-layout-map.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.-layout-map.pbtxt index 15402cd02..7f9eb8329 100644 --- a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.-layout-map.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.-layout-map.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.dtensor.experimental.LayoutMap" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adadelta.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adadelta.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adadelta.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adadelta.pbtxt index 1bde9e588..291839b6f 100644 --- a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adadelta.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adadelta.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.dtensor.experimental.optimizers.Adadelta" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adagrad.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adagrad.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adagrad.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adagrad.pbtxt index 792f67240..ce9611c88 100644 --- a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adagrad.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adagrad.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.dtensor.experimental.optimizers.Adagrad" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam-w.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam-w.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam-w.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam-w.pbtxt index 2e5c929d6..b1076333f 100644 --- a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam-w.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam-w.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.dtensor.experimental.optimizers.AdamW" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam.pbtxt index 93fe2d44b..1b18fa9e2 100644 --- a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-adam.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.dtensor.experimental.optimizers.Adam" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-r-m-sprop.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-r-m-sprop.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-r-m-sprop.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-r-m-sprop.pbtxt index 16efcd4fc..d418839e0 100644 --- a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-r-m-sprop.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-r-m-sprop.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.dtensor.experimental.optimizers.RMSprop" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-s-g-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-s-g-d.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-s-g-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-s-g-d.pbtxt index e994213fe..a431285e7 100644 --- a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-s-g-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.-s-g-d.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.dtensor.experimental.optimizers.SGD" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.optimizers.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.dtensor.experimental.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.dtensor.experimental.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.dtensor.experimental.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.dtensor.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.dtensor.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.dtensor.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.dtensor.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.estimator.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.estimator.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.estimator.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.estimator.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt similarity index 74% rename from keras/api/golden/v2/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt index 4e15111ec..143235cc5 100644 --- a/keras/api/golden/v2/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.experimental.-cosine-decay-restarts.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.experimental.CosineDecayRestarts" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.experimental.-cosine-decay.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.experimental.-cosine-decay.pbtxt similarity index 75% rename from keras/api/golden/v2/tensorflow.keras.experimental.-cosine-decay.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.experimental.-cosine-decay.pbtxt index 81bdedcb4..84321bf39 100644 --- a/keras/api/golden/v2/tensorflow.keras.experimental.-cosine-decay.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.experimental.-cosine-decay.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.experimental.CosineDecay" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.experimental.-linear-model.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.experimental.-linear-model.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.experimental.-linear-model.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.experimental.-linear-model.pbtxt index 8301a6583..97d400bf0 100644 --- a/keras/api/golden/v1/tensorflow.keras.experimental.-linear-model.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.experimental.-linear-model.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.experimental.LinearModel" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.experimental.-sequence-features.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.experimental.-sequence-features.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.experimental.-sequence-features.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.experimental.-sequence-features.pbtxt index e87a1ec3d..a4f2412d9 100644 --- a/keras/api/golden/v2/tensorflow.keras.experimental.-sequence-features.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.experimental.-sequence-features.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.experimental.SequenceFeatures" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.experimental.-sidecar-evaluator.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.experimental.-sidecar-evaluator.pbtxt similarity index 66% rename from keras/api/golden/v2/tensorflow.keras.experimental.-sidecar-evaluator.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.experimental.-sidecar-evaluator.pbtxt index 9ca14da2e..2c241a6f7 100644 --- a/keras/api/golden/v2/tensorflow.keras.experimental.-sidecar-evaluator.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.experimental.-sidecar-evaluator.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.experimental.SidecarEvaluator" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.experimental.-wide-deep-model.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.experimental.-wide-deep-model.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.experimental.-wide-deep-model.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.experimental.-wide-deep-model.pbtxt index 44e02e9b4..dfa4ae041 100644 --- a/keras/api/golden/v1/tensorflow.keras.experimental.-wide-deep-model.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.experimental.-wide-deep-model.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.experimental.WideDeepModel" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.experimental.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.experimental.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.experimental.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.experimental.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.export.-export-archive.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.export.-export-archive.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.export.-export-archive.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.export.-export-archive.pbtxt index 4b245b4b9..991e586ea 100644 --- a/keras/api/golden/v2/tensorflow.keras.export.-export-archive.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.export.-export-archive.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.export.ExportArchive" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.export.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.export.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.export.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.export.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.google.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.google.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.google.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.google.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-constant.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-constant.pbtxt similarity index 76% rename from keras/api/golden/v2/tensorflow.keras.initializers.-constant.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-constant.pbtxt index 026836fe4..f288aae8b 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-constant.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-constant.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.Constant" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-glorot-normal.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-glorot-normal.pbtxt similarity index 67% rename from keras/api/golden/v2/tensorflow.keras.initializers.-glorot-normal.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-glorot-normal.pbtxt index 570cb6015..8bc21ee28 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-glorot-normal.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-glorot-normal.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.initializers.GlorotNormal" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-glorot-uniform.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-glorot-uniform.pbtxt similarity index 67% rename from keras/api/golden/v2/tensorflow.keras.initializers.-glorot-uniform.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-glorot-uniform.pbtxt index 4f6b5719e..71685df81 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-glorot-uniform.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-glorot-uniform.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.initializers.GlorotUniform" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-he-normal.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-he-normal.pbtxt similarity index 67% rename from keras/api/golden/v2/tensorflow.keras.initializers.-he-normal.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-he-normal.pbtxt index af6f28ad7..4d4074d34 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-he-normal.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-he-normal.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.initializers.HeNormal" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-he-uniform.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-he-uniform.pbtxt similarity index 67% rename from keras/api/golden/v2/tensorflow.keras.initializers.-he-uniform.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-he-uniform.pbtxt index a3ae35b25..d765b5982 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-he-uniform.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-he-uniform.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.initializers.HeUniform" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-identity.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-identity.pbtxt similarity index 76% rename from keras/api/golden/v2/tensorflow.keras.initializers.-identity.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-identity.pbtxt index 11d9180d0..df5b2951c 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-identity.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-identity.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.Identity" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.initializers.-initializer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-initializer.pbtxt similarity index 83% rename from keras/api/golden/v1/tensorflow.keras.initializers.-initializer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-initializer.pbtxt index 848e5d352..809c91209 100644 --- a/keras/api/golden/v1/tensorflow.keras.initializers.-initializer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-initializer.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.initializers.Initializer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-lecun-normal.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-lecun-normal.pbtxt similarity index 67% rename from keras/api/golden/v2/tensorflow.keras.initializers.-lecun-normal.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-lecun-normal.pbtxt index 1a3b20240..e1a600be6 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-lecun-normal.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-lecun-normal.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.initializers.LecunNormal" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-lecun-uniform.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-lecun-uniform.pbtxt similarity index 67% rename from keras/api/golden/v2/tensorflow.keras.initializers.-lecun-uniform.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-lecun-uniform.pbtxt index cb09e8963..f39b28e64 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-lecun-uniform.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-lecun-uniform.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.initializers.LecunUniform" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-ones.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-ones.pbtxt similarity index 72% rename from keras/api/golden/v2/tensorflow.keras.initializers.-ones.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-ones.pbtxt index 78065e847..274e5aa7b 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-ones.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-ones.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.Ones" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-orthogonal.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-orthogonal.pbtxt similarity index 76% rename from keras/api/golden/v2/tensorflow.keras.initializers.-orthogonal.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-orthogonal.pbtxt index 162346856..d510e1615 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-orthogonal.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-orthogonal.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.Orthogonal" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-random-normal.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-random-normal.pbtxt similarity index 77% rename from keras/api/golden/v2/tensorflow.keras.initializers.-random-normal.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-random-normal.pbtxt index d56e2e30d..51836a7e0 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-random-normal.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-random-normal.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.RandomNormal" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-random-uniform.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-random-uniform.pbtxt similarity index 77% rename from keras/api/golden/v2/tensorflow.keras.initializers.-random-uniform.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-random-uniform.pbtxt index a80f1ea48..3ad0e3a86 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-random-uniform.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-random-uniform.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.RandomUniform" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-truncated-normal.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-truncated-normal.pbtxt similarity index 77% rename from keras/api/golden/v2/tensorflow.keras.initializers.-truncated-normal.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-truncated-normal.pbtxt index 38c1b18ae..48cc06f31 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-truncated-normal.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-truncated-normal.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.TruncatedNormal" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-variance-scaling.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-variance-scaling.pbtxt similarity index 78% rename from keras/api/golden/v2/tensorflow.keras.initializers.-variance-scaling.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-variance-scaling.pbtxt index 52b639a1a..0959af32f 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-variance-scaling.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-variance-scaling.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.VarianceScaling" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.-zeros.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-zeros.pbtxt similarity index 72% rename from keras/api/golden/v2/tensorflow.keras.initializers.-zeros.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.-zeros.pbtxt index 263040949..0b4c4cf9b 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.-zeros.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.-zeros.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.Zeros" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.constant.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.constant.pbtxt similarity index 76% rename from keras/api/golden/v2/tensorflow.keras.initializers.constant.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.constant.pbtxt index fedf0b9a1..97058469a 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.constant.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.constant.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.constant" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.glorot_normal.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.glorot_normal.pbtxt similarity index 67% rename from keras/api/golden/v2/tensorflow.keras.initializers.glorot_normal.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.glorot_normal.pbtxt index 35bbb24fa..fe974cd44 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.glorot_normal.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.glorot_normal.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.initializers.glorot_normal" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.glorot_uniform.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.glorot_uniform.pbtxt similarity index 67% rename from keras/api/golden/v2/tensorflow.keras.initializers.glorot_uniform.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.glorot_uniform.pbtxt index 76eb02bbf..4c3d2e076 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.glorot_uniform.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.glorot_uniform.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.initializers.glorot_uniform" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.he_normal.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.he_normal.pbtxt similarity index 67% rename from keras/api/golden/v2/tensorflow.keras.initializers.he_normal.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.he_normal.pbtxt index 59ee38972..c4aaf057e 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.he_normal.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.he_normal.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.initializers.he_normal" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.he_uniform.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.he_uniform.pbtxt similarity index 67% rename from keras/api/golden/v2/tensorflow.keras.initializers.he_uniform.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.he_uniform.pbtxt index f1b7ce285..31c3a7319 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.he_uniform.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.he_uniform.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.initializers.he_uniform" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.identity.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.identity.pbtxt similarity index 76% rename from keras/api/golden/v2/tensorflow.keras.initializers.identity.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.identity.pbtxt index 6b4b4cee8..2ab057eff 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.identity.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.identity.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.identity" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.lecun_normal.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.lecun_normal.pbtxt similarity index 67% rename from keras/api/golden/v2/tensorflow.keras.initializers.lecun_normal.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.lecun_normal.pbtxt index e68026301..6fb9a2738 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.lecun_normal.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.lecun_normal.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.initializers.lecun_normal" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.lecun_uniform.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.lecun_uniform.pbtxt similarity index 67% rename from keras/api/golden/v2/tensorflow.keras.initializers.lecun_uniform.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.lecun_uniform.pbtxt index 1d8f833fc..aeabe71c9 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.lecun_uniform.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.lecun_uniform.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.initializers.lecun_uniform" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.ones.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.ones.pbtxt similarity index 72% rename from keras/api/golden/v2/tensorflow.keras.initializers.ones.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.ones.pbtxt index 4b6fccb96..c8a8b25bf 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.ones.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.ones.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.ones" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.orthogonal.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.orthogonal.pbtxt similarity index 76% rename from keras/api/golden/v2/tensorflow.keras.initializers.orthogonal.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.orthogonal.pbtxt index 5e9e3cad9..29e9ce794 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.orthogonal.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.orthogonal.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.orthogonal" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.initializers.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.random_normal.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.random_normal.pbtxt similarity index 77% rename from keras/api/golden/v2/tensorflow.keras.initializers.random_normal.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.random_normal.pbtxt index 15ab42e95..a02473f32 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.random_normal.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.random_normal.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.random_normal" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.random_uniform.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.random_uniform.pbtxt similarity index 77% rename from keras/api/golden/v2/tensorflow.keras.initializers.random_uniform.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.random_uniform.pbtxt index 3e54ce21b..f8202bdb2 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.random_uniform.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.random_uniform.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.random_uniform" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.truncated_normal.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.truncated_normal.pbtxt similarity index 77% rename from keras/api/golden/v2/tensorflow.keras.initializers.truncated_normal.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.truncated_normal.pbtxt index 65d698377..cfbcaacb5 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.truncated_normal.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.truncated_normal.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.truncated_normal" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.variance_scaling.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.variance_scaling.pbtxt similarity index 78% rename from keras/api/golden/v2/tensorflow.keras.initializers.variance_scaling.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.variance_scaling.pbtxt index f59861039..8f7905f13 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.variance_scaling.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.variance_scaling.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.variance_scaling" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.initializers.zeros.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.initializers.zeros.pbtxt similarity index 72% rename from keras/api/golden/v2/tensorflow.keras.initializers.zeros.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.initializers.zeros.pbtxt index 2c4213342..93329d096 100644 --- a/keras/api/golden/v2/tensorflow.keras.initializers.zeros.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.initializers.zeros.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.initializers.zeros" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt index d7238394f..748671348 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-abstract-r-n-n-cell.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.AbstractRNNCell" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-activation.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-activation.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-activation.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-activation.pbtxt index d1ee21e3e..ae03ae751 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-activation.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-activation.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Activation" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-activity-regularization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-activity-regularization.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-activity-regularization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-activity-regularization.pbtxt index 8c47a6125..a7b62bd7b 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-activity-regularization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-activity-regularization.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ActivityRegularization" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-add.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-add.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-add.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-add.pbtxt index 5127ff3df..aa163d114 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-add.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-add.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Add" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-additive-attention.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-additive-attention.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-additive-attention.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-additive-attention.pbtxt index 8ed84a4a7..c5c19885b 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-additive-attention.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-additive-attention.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.AdditiveAttention" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-alpha-dropout.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-alpha-dropout.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-alpha-dropout.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-alpha-dropout.pbtxt index b65b0c1c1..62d5c778e 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-alpha-dropout.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-alpha-dropout.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AlphaDropout" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-attention.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-attention.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-attention.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-attention.pbtxt index c8c3027e9..64d449869 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-attention.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-attention.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Attention" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-average-pooling1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-average-pooling1-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-average-pooling1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-average-pooling1-d.pbtxt index d1d687125..955df3fc9 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-average-pooling1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-average-pooling1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AveragePooling1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-average-pooling2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-average-pooling2-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-average-pooling2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-average-pooling2-d.pbtxt index c3c3f7027..ffb2fc00b 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-average-pooling2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-average-pooling2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AveragePooling2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-average-pooling3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-average-pooling3-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-average-pooling3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-average-pooling3-d.pbtxt index cdd976ab9..eccd897d6 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-average-pooling3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-average-pooling3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AveragePooling3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-average.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-average.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-average.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-average.pbtxt index 5552bd555..73d7f8548 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-average.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-average.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Average" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-avg-pool1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-avg-pool1-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-avg-pool1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-avg-pool1-d.pbtxt index 0fb5acc44..6f192d650 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-avg-pool1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-avg-pool1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AvgPool1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-avg-pool2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-avg-pool2-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-avg-pool2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-avg-pool2-d.pbtxt index b46848ddf..b81fce3d4 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-avg-pool2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-avg-pool2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AvgPool2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-avg-pool3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-avg-pool3-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-avg-pool3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-avg-pool3-d.pbtxt index c5f4a9b9b..208cd87c5 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-avg-pool3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-avg-pool3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.AvgPool3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-batch-normalization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-batch-normalization.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-batch-normalization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-batch-normalization.pbtxt index 042922577..dc89abbf5 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-batch-normalization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-batch-normalization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.BatchNormalization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-bidirectional.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-bidirectional.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-bidirectional.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-bidirectional.pbtxt index 4df4de922..b1c65fca1 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-bidirectional.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-bidirectional.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Bidirectional" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-category-encoding.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-category-encoding.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-category-encoding.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-category-encoding.pbtxt index dfa0cbaba..217a29b3a 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-category-encoding.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-category-encoding.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.CategoryEncoding" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-center-crop.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-center-crop.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-center-crop.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-center-crop.pbtxt index c4a5aa0e3..a1f56746a 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-center-crop.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-center-crop.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.CenterCrop" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-concatenate.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-concatenate.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-concatenate.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-concatenate.pbtxt index 229006d48..aff64158f 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-concatenate.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-concatenate.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Concatenate" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt index 13da3b785..111a67608 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m1-d.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.layers.ConvLSTM1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activation" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt index 341d73a2c..16e781b78 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m2-d.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.layers.ConvLSTM2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activation" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt index e6257107a..40b7c80fa 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv-l-s-t-m3-d.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.layers.ConvLSTM3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activation" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-conv1-d-transpose.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv1-d-transpose.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-conv1-d-transpose.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-conv1-d-transpose.pbtxt index 5b3beb8b1..0059d2b8b 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-conv1-d-transpose.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv1-d-transpose.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Conv1DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-conv1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv1-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-conv1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-conv1-d.pbtxt index 5dff50a6f..59c5243c5 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-conv1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Conv1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-conv2-d-transpose.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv2-d-transpose.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-conv2-d-transpose.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-conv2-d-transpose.pbtxt index 67f03d1ce..2a621f0a8 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-conv2-d-transpose.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv2-d-transpose.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Conv2DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-conv2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv2-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-conv2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-conv2-d.pbtxt index 7413b8674..2202bd4bd 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-conv2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Conv2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-conv3-d-transpose.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv3-d-transpose.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-conv3-d-transpose.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-conv3-d-transpose.pbtxt index c66d6ffb3..0f36f535a 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-conv3-d-transpose.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv3-d-transpose.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Conv3DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-conv3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv3-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-conv3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-conv3-d.pbtxt index 5c0774f96..347e6e087 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-conv3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-conv3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Conv3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt index 7484ce7eb..3a3ed5080 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution1-d-transpose.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Convolution1DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-convolution1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution1-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-convolution1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution1-d.pbtxt index 418e5d2b6..4e383afa8 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-convolution1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Convolution1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt index dc4369ec9..ca0345a6c 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution2-d-transpose.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Convolution2DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-convolution2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution2-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-convolution2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution2-d.pbtxt index 47258f583..810411ee3 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-convolution2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Convolution2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt index 8219381a5..7d3245a50 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution3-d-transpose.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.Convolution3DTranspose" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-convolution3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution3-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-convolution3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution3-d.pbtxt index b334463bb..32c2cb0f3 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-convolution3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-convolution3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Convolution3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-cropping1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-cropping1-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-cropping1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-cropping1-d.pbtxt index 1d516ece0..68a3969d1 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-cropping1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-cropping1-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Cropping1D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-cropping2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-cropping2-d.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-cropping2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-cropping2-d.pbtxt index 569ff8d26..d1d55a037 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-cropping2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-cropping2-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Cropping2D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-cropping3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-cropping3-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-cropping3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-cropping3-d.pbtxt index 0d1f2865f..f1cfc55d2 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-cropping3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-cropping3-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Cropping3D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-dense-features.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-dense-features.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-dense-features.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-dense-features.pbtxt index cb71ae4d6..9be76c677 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-dense-features.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-dense-features.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.DenseFeatures" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-dense.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-dense.pbtxt similarity index 97% rename from keras/api/golden/v2/tensorflow.keras.layers.-dense.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-dense.pbtxt index b29161038..bd769b50d 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-dense.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-dense.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Dense" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt index 5d3179479..ef151373c 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-depthwise-conv1-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.DepthwiseConv1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt index 42f987270..56829d58d 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-depthwise-conv2-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.DepthwiseConv2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-discretization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-discretization.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-discretization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-discretization.pbtxt index 5563d6138..f6bf75e7d 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-discretization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-discretization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Discretization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-dot.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-dot.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-dot.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-dot.pbtxt index a43e3ea8e..b1782d8fe 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-dot.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-dot.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Dot" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-dropout.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-dropout.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-dropout.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-dropout.pbtxt index 0c504b387..204209656 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-dropout.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-dropout.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Dropout" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-e-l-u.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-e-l-u.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-e-l-u.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-e-l-u.pbtxt index 338f8569b..efbaa4268 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-e-l-u.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-e-l-u.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ELU" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-einsum-dense.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-einsum-dense.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-einsum-dense.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-einsum-dense.pbtxt index 0d878e1b6..4afe8b5d1 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-einsum-dense.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-einsum-dense.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.EinsumDense" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-embedding.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-embedding.pbtxt similarity index 97% rename from keras/api/golden/v2/tensorflow.keras.layers.-embedding.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-embedding.pbtxt index d0acb29f4..762b2049b 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-embedding.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-embedding.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Embedding" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-flatten.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-flatten.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-flatten.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-flatten.pbtxt index 26ff20793..625d87e69 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-flatten.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-flatten.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Flatten" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-g-r-u-cell.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-g-r-u-cell.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-g-r-u-cell.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-g-r-u-cell.pbtxt index 0ecc1109c..8a5ace6f5 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-g-r-u-cell.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-g-r-u-cell.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.GRUCell" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-g-r-u.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-g-r-u.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-g-r-u.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-g-r-u.pbtxt index cabd8b355..049d3e60a 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-g-r-u.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-g-r-u.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.layers.GRU" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activation" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-gaussian-dropout.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-gaussian-dropout.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-gaussian-dropout.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-gaussian-dropout.pbtxt index cfafd9e73..635bfb14f 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-gaussian-dropout.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-gaussian-dropout.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GaussianDropout" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-gaussian-noise.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-gaussian-noise.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-gaussian-noise.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-gaussian-noise.pbtxt index 03c265aeb..1e72a1e74 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-gaussian-noise.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-gaussian-noise.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GaussianNoise" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt index aaffbb424..c0b86e19b 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalAveragePooling1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt index 5a5d64006..3e455cd4b 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalAveragePooling2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt index d211a3a0a..2db1c9e58 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-average-pooling3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalAveragePooling3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt index f98c5fe73..a7f80fc01 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalAvgPool1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt index 93ccb22cc..c3939a4ff 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalAvgPool2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt index f8a2802d8..74efb12d7 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-avg-pool3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalAvgPool3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool1-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool1-d.pbtxt index 0c9d82c99..6efa24aaf 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalMaxPool1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool2-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool2-d.pbtxt index 6aa97dfdc..02ef5bf93 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalMaxPool2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool3-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool3-d.pbtxt index 80177870b..b9f013160 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-global-max-pool3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pool3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalMaxPool3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt index 8b9a4c6e7..43f509984 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalMaxPooling1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt index 8f4bf30b4..7f3bdc34c 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalMaxPooling2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt index b165d9842..e902b91b6 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-global-max-pooling3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.GlobalMaxPooling3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-group-normalization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-group-normalization.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-group-normalization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-group-normalization.pbtxt index fced5da81..739f200df 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-group-normalization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-group-normalization.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.GroupNormalization" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-hashed-crossing.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-hashed-crossing.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-hashed-crossing.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-hashed-crossing.pbtxt index eab9f207e..3e7634eaa 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-hashed-crossing.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-hashed-crossing.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.HashedCrossing" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-hashing.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-hashing.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-hashing.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-hashing.pbtxt index ef1b9e56c..92b0ef1b6 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-hashing.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-hashing.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Hashing" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-identity.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-identity.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-identity.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-identity.pbtxt index 3c3e39996..af2a92d4b 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-identity.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-identity.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Identity" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-input-layer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-input-layer.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-input-layer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-input-layer.pbtxt index 7564a7f8b..e5b3e97d3 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-input-layer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-input-layer.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.InputLayer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-input-spec.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-input-spec.pbtxt similarity index 90% rename from keras/api/golden/v2/tensorflow.keras.layers.-input-spec.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-input-spec.pbtxt index 6f146e09d..5aef9ca71 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-input-spec.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-input-spec.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.layers.InputSpec" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-integer-lookup.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-integer-lookup.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-integer-lookup.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-integer-lookup.pbtxt index 60e70390c..5c0249e7f 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-integer-lookup.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-integer-lookup.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.IntegerLookup" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt index d038c1493..af4d70745 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-l-s-t-m-cell.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.LSTMCell" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-l-s-t-m.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-l-s-t-m.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-l-s-t-m.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-l-s-t-m.pbtxt index 893a35071..fcea1e31a 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-l-s-t-m.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-l-s-t-m.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.layers.LSTM" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activation" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-lambda.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-lambda.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-lambda.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-lambda.pbtxt index bb97d088d..f62727dec 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-lambda.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-lambda.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Lambda" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-layer-normalization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-layer-normalization.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-layer-normalization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-layer-normalization.pbtxt index 1a81ce6f1..b693a8f04 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-layer-normalization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-layer-normalization.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.LayerNormalization" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-layer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-layer.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.layers.-layer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-layer.pbtxt index b50481b62..c5db2db8a 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-layer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-layer.pbtxt @@ -1,10 +1,10 @@ path: "tensorflow.keras.layers.Layer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-leaky-re-l-u.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-leaky-re-l-u.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-leaky-re-l-u.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-leaky-re-l-u.pbtxt index 96cc14f91..8df259864 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-leaky-re-l-u.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-leaky-re-l-u.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.LeakyReLU" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-locally-connected1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-locally-connected1-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-locally-connected1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-locally-connected1-d.pbtxt index f8b6b11e2..d6ea87ea9 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-locally-connected1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-locally-connected1-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.LocallyConnected1D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-locally-connected2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-locally-connected2-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-locally-connected2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-locally-connected2-d.pbtxt index fb34dfb1c..e450854e5 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-locally-connected2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-locally-connected2-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.LocallyConnected2D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-masking.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-masking.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-masking.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-masking.pbtxt index cb3ac42a4..8e565b108 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-masking.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-masking.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Masking" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-max-pool1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pool1-d.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-max-pool1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pool1-d.pbtxt index 0d9dc7499..d39cc3399 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-max-pool1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pool1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.MaxPool1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-max-pool2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pool2-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-max-pool2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pool2-d.pbtxt index e1092bf07..9fcdea298 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-max-pool2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pool2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.MaxPool2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-max-pool3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pool3-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-max-pool3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pool3-d.pbtxt index 4696c5863..8c66e26f8 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-max-pool3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pool3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.MaxPool3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-max-pooling1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pooling1-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-max-pooling1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pooling1-d.pbtxt index a021d15e3..977c8d409 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-max-pooling1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pooling1-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.MaxPooling1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-max-pooling2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pooling2-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-max-pooling2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pooling2-d.pbtxt index 8bea460ac..971cf5d84 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-max-pooling2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pooling2-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.MaxPooling2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-max-pooling3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pooling3-d.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-max-pooling3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pooling3-d.pbtxt index 14a7d00de..25451d194 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-max-pooling3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-max-pooling3-d.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.MaxPooling3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-maximum.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-maximum.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-maximum.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-maximum.pbtxt index cc8218f7a..c87608ef5 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-maximum.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-maximum.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Maximum" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-minimum.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-minimum.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-minimum.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-minimum.pbtxt index 709c847a6..e9eab7fda 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-minimum.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-minimum.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Minimum" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-multi-head-attention.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-multi-head-attention.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-multi-head-attention.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-multi-head-attention.pbtxt index 4b8080a1b..4f4e7dddd 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-multi-head-attention.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-multi-head-attention.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.MultiHeadAttention" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-multiply.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-multiply.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-multiply.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-multiply.pbtxt index 3ef05dd00..865438c75 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-multiply.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-multiply.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Multiply" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-normalization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-normalization.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-normalization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-normalization.pbtxt index baa8fba13..f0dba4c51 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-normalization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-normalization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Normalization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-p-re-l-u.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-p-re-l-u.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-p-re-l-u.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-p-re-l-u.pbtxt index 899af13f3..ceeaab91e 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-p-re-l-u.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-p-re-l-u.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.PReLU" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-permute.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-permute.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-permute.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-permute.pbtxt index e08c63815..e8c29bdbe 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-permute.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-permute.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Permute" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-r-n-n.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-r-n-n.pbtxt similarity index 97% rename from keras/api/golden/v2/tensorflow.keras.layers.-r-n-n.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-r-n-n.pbtxt index 4dc7b8c60..21194235c 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-r-n-n.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-r-n-n.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.RNN" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-random-brightness.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-brightness.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-random-brightness.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-random-brightness.pbtxt index d246250fb..b1cd72974 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-random-brightness.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-brightness.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.RandomBrightness" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-random-contrast.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-contrast.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-random-contrast.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-random-contrast.pbtxt index 85454d842..dfa5a4b6e 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-random-contrast.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-contrast.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.RandomContrast" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-random-crop.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-crop.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-random-crop.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-random-crop.pbtxt index 23f80ad15..286045699 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-random-crop.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-crop.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.RandomCrop" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-random-flip.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-flip.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-random-flip.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-random-flip.pbtxt index 0807d1d10..7326f5d60 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-random-flip.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-flip.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.RandomFlip" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-random-height.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-height.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-random-height.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-random-height.pbtxt index 9ce1de081..a9dfb7e70 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-random-height.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-height.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.RandomHeight" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-random-rotation.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-rotation.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-random-rotation.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-random-rotation.pbtxt index df4e253ee..6113113fb 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-random-rotation.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-rotation.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.RandomRotation" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-random-translation.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-translation.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-random-translation.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-random-translation.pbtxt index 97cbab083..665dd1b4b 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-random-translation.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-translation.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.RandomTranslation" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-random-width.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-width.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-random-width.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-random-width.pbtxt index 2f566e0cf..bb892f72e 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-random-width.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-width.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.RandomWidth" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-random-zoom.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-zoom.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-random-zoom.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-random-zoom.pbtxt index 9997add64..e47009c0c 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-random-zoom.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-random-zoom.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.RandomZoom" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-re-l-u.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-re-l-u.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-re-l-u.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-re-l-u.pbtxt index 831131154..4cf619fe1 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-re-l-u.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-re-l-u.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ReLU" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-repeat-vector.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-repeat-vector.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-repeat-vector.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-repeat-vector.pbtxt index a401a54ae..d289a93fb 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-repeat-vector.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-repeat-vector.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.RepeatVector" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-rescaling.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-rescaling.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-rescaling.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-rescaling.pbtxt index 2b52e5fa3..99ca24ded 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-rescaling.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-rescaling.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Rescaling" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-reshape.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-reshape.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-reshape.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-reshape.pbtxt index 8af2743e9..608c6a524 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-reshape.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-reshape.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Reshape" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-resizing.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-resizing.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-resizing.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-resizing.pbtxt index f04ecffd3..a5e0362a7 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-resizing.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-resizing.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Resizing" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-separable-conv1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-separable-conv1-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-separable-conv1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-separable-conv1-d.pbtxt index 6922c5910..56fc9e618 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-separable-conv1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-separable-conv1-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SeparableConv1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-separable-conv2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-separable-conv2-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-separable-conv2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-separable-conv2-d.pbtxt index b4d943239..e7ed3b8d8 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-separable-conv2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-separable-conv2-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SeparableConv2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-separable-convolution1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-separable-convolution1-d.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-separable-convolution1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-separable-convolution1-d.pbtxt index d21d6693b..6533cc3fa 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-separable-convolution1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-separable-convolution1-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SeparableConvolution1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-separable-convolution2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-separable-convolution2-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-separable-convolution2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-separable-convolution2-d.pbtxt index 312c27f69..cb53efb85 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-separable-convolution2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-separable-convolution2-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SeparableConvolution2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt index 20da793c2..15355a4dc 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-simple-r-n-n-cell.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SimpleRNNCell" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-simple-r-n-n.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-simple-r-n-n.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-simple-r-n-n.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-simple-r-n-n.pbtxt index 60a8f5172..48ffdd35c 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-simple-r-n-n.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-simple-r-n-n.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.SimpleRNN" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activation" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-softmax.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-softmax.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-softmax.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-softmax.pbtxt index e8e05a00e..bf209e5fd 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-softmax.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-softmax.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Softmax" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt index 0f926be02..7d69efc04 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout1-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SpatialDropout1D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt index 1bb81438f..45a00b554 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout2-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SpatialDropout2D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt index f31ec33f7..4ba331d14 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-spatial-dropout3-d.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.SpatialDropout3D" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-spectral-normalization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-spectral-normalization.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-spectral-normalization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-spectral-normalization.pbtxt index 72a04d40b..856038900 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-spectral-normalization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-spectral-normalization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.SpectralNormalization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt index 747de047f..bd1c7943a 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-stacked-r-n-n-cells.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.StackedRNNCells" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-string-lookup.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-string-lookup.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-string-lookup.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-string-lookup.pbtxt index 2b3d513fe..14a95346e 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-string-lookup.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-string-lookup.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.StringLookup" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-subtract.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-subtract.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.-subtract.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-subtract.pbtxt index d6bba621d..75e8f476c 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-subtract.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-subtract.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.Subtract" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-text-vectorization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-text-vectorization.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-text-vectorization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-text-vectorization.pbtxt index 8824c0eac..662d6f6d0 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-text-vectorization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-text-vectorization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.TextVectorization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt index 835f784b2..9438ede74 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-thresholded-re-l-u.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ThresholdedReLU" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.-time-distributed.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-time-distributed.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.-time-distributed.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-time-distributed.pbtxt index 814d71686..d688747aa 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.-time-distributed.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-time-distributed.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.TimeDistributed" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-unit-normalization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-unit-normalization.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-unit-normalization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-unit-normalization.pbtxt index ae5f06b38..a79c689af 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-unit-normalization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-unit-normalization.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.UnitNormalization" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-up-sampling1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-up-sampling1-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-up-sampling1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-up-sampling1-d.pbtxt index ff61b890c..425cfb420 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-up-sampling1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-up-sampling1-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.UpSampling1D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-up-sampling2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-up-sampling2-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-up-sampling2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-up-sampling2-d.pbtxt index 383e28967..a9f9c4c58 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-up-sampling2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-up-sampling2-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.UpSampling2D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-up-sampling3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-up-sampling3-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-up-sampling3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-up-sampling3-d.pbtxt index b2a2d89c1..f446fdb9b 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-up-sampling3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-up-sampling3-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.UpSampling3D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-wrapper.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-wrapper.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-wrapper.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-wrapper.pbtxt index 149f9e616..201c09f6e 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-wrapper.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-wrapper.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.Wrapper" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-zero-padding1-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-zero-padding1-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-zero-padding1-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-zero-padding1-d.pbtxt index 2ef8d53b6..41b0b95b7 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-zero-padding1-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-zero-padding1-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ZeroPadding1D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-zero-padding2-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-zero-padding2-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-zero-padding2-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-zero-padding2-d.pbtxt index 5f5c510ec..9862bb309 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-zero-padding2-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-zero-padding2-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ZeroPadding2D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.-zero-padding3-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.-zero-padding3-d.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.-zero-padding3-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.-zero-padding3-d.pbtxt index 03fc8519b..3051e3a0c 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.-zero-padding3-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.-zero-padding3-d.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.ZeroPadding3D" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt index 0da8e034e..814e49b95 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.-einsum-dense.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.EinsumDense" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt index fb529f555..5cddc7fba 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.-random-fourier-features.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.RandomFourierFeatures" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.-sync-batch-normalization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.-sync-batch-normalization.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.-sync-batch-normalization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.-sync-batch-normalization.pbtxt index 63b1be08d..305196719 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.-sync-batch-normalization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.-sync-batch-normalization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.SyncBatchNormalization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt index a741778c7..9a3081c41 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-category-encoding.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.preprocessing.CategoryEncoding" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt index b2b7d584a..f472c16f5 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-center-crop.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.preprocessing.CenterCrop" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt index f61c4f82c..2ca1cc8ea 100644 --- a/keras/api/golden/v1/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-discretization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.preprocessing.Discretization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashed-crossing.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashed-crossing.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashed-crossing.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashed-crossing.pbtxt index 9a9602229..67bb10048 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashed-crossing.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashed-crossing.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.preprocessing.HashedCrossing" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt index a608049a6..add667704 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-hashing.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.preprocessing.Hashing" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-integer-lookup.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-integer-lookup.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-integer-lookup.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-integer-lookup.pbtxt index d221e8bc2..d51e33ff2 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-integer-lookup.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-integer-lookup.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.experimental.preprocessing.IntegerLookup" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt index e6f797f63..5d0c878bf 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-normalization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.preprocessing.Normalization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt index 942ce222c..5f2a971b0 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-preprocessing-layer.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.preprocessing.PreprocessingLayer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-contrast.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-contrast.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-contrast.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-contrast.pbtxt index 4a98b7dc7..79a690a7c 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-contrast.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-contrast.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.preprocessing.RandomContrast" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-crop.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-crop.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-crop.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-crop.pbtxt index ff0e93b7a..90495e279 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-crop.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-crop.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.preprocessing.RandomCrop" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-flip.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-flip.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-flip.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-flip.pbtxt index dcd4bc07b..3f1d8d6bc 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-flip.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-flip.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.preprocessing.RandomFlip" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-height.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-height.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-height.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-height.pbtxt index 2d5ada3de..68d605c36 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-height.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-height.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.preprocessing.RandomHeight" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-rotation.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-rotation.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-rotation.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-rotation.pbtxt index 634d29f45..8c6e9def9 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-rotation.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-rotation.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.preprocessing.RandomRotation" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-translation.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-translation.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-translation.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-translation.pbtxt index bfb769358..3ab14a27b 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-translation.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-translation.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.preprocessing.RandomTranslation" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-width.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-width.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-width.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-width.pbtxt index c2d3ef92b..a217c06fc 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-width.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-width.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.preprocessing.RandomWidth" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-zoom.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-zoom.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-zoom.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-zoom.pbtxt index ff3f05b1f..563b4d27e 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-zoom.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-random-zoom.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.preprocessing.RandomZoom" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt index fdbab2467..c41e5e8e0 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-rescaling.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.preprocessing.Rescaling" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt index c11fb5969..b52a307cb 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-resizing.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.layers.experimental.preprocessing.Resizing" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-string-lookup.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-string-lookup.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-string-lookup.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-string-lookup.pbtxt index f7ee995f2..90b8d6a1c 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-string-lookup.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-string-lookup.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.layers.experimental.preprocessing.StringLookup" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-text-vectorization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-text-vectorization.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-text-vectorization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-text-vectorization.pbtxt index d9c28d3a3..28edefe5d 100644 --- a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-text-vectorization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.-text-vectorization.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.layers.experimental.preprocessing.TextVectorization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.experimental.preprocessing.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.layers.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.layers.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.layers.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.layers.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-binary-crossentropy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-binary-crossentropy.pbtxt similarity index 80% rename from keras/api/golden/v2/tensorflow.keras.losses.-binary-crossentropy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-binary-crossentropy.pbtxt index 9affaaf6e..098184bfd 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-binary-crossentropy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-binary-crossentropy.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.BinaryCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt similarity index 81% rename from keras/api/golden/v1/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt index ac49b8fc8..dd0eb62f9 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-binary-focal-crossentropy.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.BinaryFocalCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-categorical-crossentropy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-categorical-crossentropy.pbtxt similarity index 80% rename from keras/api/golden/v2/tensorflow.keras.losses.-categorical-crossentropy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-categorical-crossentropy.pbtxt index 7a50f8b0e..c74f381de 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-categorical-crossentropy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-categorical-crossentropy.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.CategoricalCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt similarity index 80% rename from keras/api/golden/v1/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt index f06b44ec8..ed5e93427 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-categorical-focal-crossentropy.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.CategoricalFocalCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-categorical-hinge.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-categorical-hinge.pbtxt similarity index 78% rename from keras/api/golden/v1/tensorflow.keras.losses.-categorical-hinge.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-categorical-hinge.pbtxt index fc23af9c5..f26aa5fa3 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-categorical-hinge.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-categorical-hinge.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.CategoricalHinge" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-cosine-similarity.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-cosine-similarity.pbtxt similarity index 79% rename from keras/api/golden/v1/tensorflow.keras.losses.-cosine-similarity.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-cosine-similarity.pbtxt index 7bd4ab61c..8888b3554 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-cosine-similarity.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-cosine-similarity.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.CosineSimilarity" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-hinge.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-hinge.pbtxt similarity index 79% rename from keras/api/golden/v1/tensorflow.keras.losses.-hinge.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-hinge.pbtxt index a154c2a29..18bbfe822 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-hinge.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-hinge.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.Hinge" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-huber.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-huber.pbtxt similarity index 79% rename from keras/api/golden/v2/tensorflow.keras.losses.-huber.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-huber.pbtxt index b9da506b5..1ee7aa9b4 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-huber.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-huber.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.Huber" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-k-l-divergence.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-k-l-divergence.pbtxt similarity index 79% rename from keras/api/golden/v1/tensorflow.keras.losses.-k-l-divergence.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-k-l-divergence.pbtxt index b16a275a9..ab9e9523a 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-k-l-divergence.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-k-l-divergence.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.KLDivergence" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-log-cosh.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-log-cosh.pbtxt similarity index 79% rename from keras/api/golden/v2/tensorflow.keras.losses.-log-cosh.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-log-cosh.pbtxt index 97253a93e..e68b80633 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-log-cosh.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-log-cosh.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.LogCosh" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-loss.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-loss.pbtxt similarity index 92% rename from keras/api/golden/v2/tensorflow.keras.losses.-loss.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-loss.pbtxt index f6e062b14..8453fc3ed 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-loss.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-loss.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.losses.Loss" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-mean-absolute-error.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-mean-absolute-error.pbtxt similarity index 78% rename from keras/api/golden/v2/tensorflow.keras.losses.-mean-absolute-error.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-mean-absolute-error.pbtxt index 91dab6787..4bf4307fc 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-mean-absolute-error.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-mean-absolute-error.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.MeanAbsoluteError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt similarity index 78% rename from keras/api/golden/v2/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt index f4c1b5cf0..8d7634ef6 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-mean-absolute-percentage-error.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.MeanAbsolutePercentageError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-mean-squared-error.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-mean-squared-error.pbtxt similarity index 78% rename from keras/api/golden/v2/tensorflow.keras.losses.-mean-squared-error.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-mean-squared-error.pbtxt index 815bddaf3..2f1caf77b 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-mean-squared-error.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-mean-squared-error.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.MeanSquaredError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt similarity index 78% rename from keras/api/golden/v2/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt index d08388055..ade043a0b 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-mean-squared-logarithmic-error.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.MeanSquaredLogarithmicError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.losses.-poisson.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-poisson.pbtxt similarity index 79% rename from keras/api/golden/v1/tensorflow.keras.losses.-poisson.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-poisson.pbtxt index 5313398aa..5e29b0542 100644 --- a/keras/api/golden/v1/tensorflow.keras.losses.-poisson.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-poisson.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.Poisson" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-reduction.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-reduction.pbtxt similarity index 90% rename from keras/api/golden/v2/tensorflow.keras.losses.-reduction.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-reduction.pbtxt index 226a8ba19..5f4ed65f1 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-reduction.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-reduction.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.losses.Reduction" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member { name: "AUTO" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt similarity index 79% rename from keras/api/golden/v2/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt index 389b05c75..ab33022ab 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-sparse-categorical-crossentropy.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.SparseCategoricalCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.-squared-hinge.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.-squared-hinge.pbtxt similarity index 79% rename from keras/api/golden/v2/tensorflow.keras.losses.-squared-hinge.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.-squared-hinge.pbtxt index 3f2cf2c5b..33e70ce25 100644 --- a/keras/api/golden/v2/tensorflow.keras.losses.-squared-hinge.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.losses.-squared-hinge.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.losses.SquaredHinge" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.losses.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.losses.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.losses.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.losses.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-a-u-c.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-a-u-c.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.metrics.-a-u-c.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-a-u-c.pbtxt index 171da23f3..ffd4b2c07 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-a-u-c.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-a-u-c.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.metrics.AUC" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-accuracy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-accuracy.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-accuracy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-accuracy.pbtxt index 863b94844..a67b0a670 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-accuracy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-accuracy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.Accuracy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-binary-accuracy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-binary-accuracy.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-binary-accuracy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-binary-accuracy.pbtxt index 4b8759cf7..fcc6c6266 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-binary-accuracy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-binary-accuracy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.BinaryAccuracy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-binary-crossentropy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-binary-crossentropy.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-binary-crossentropy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-binary-crossentropy.pbtxt index 16228d422..afcbda97b 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-binary-crossentropy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-binary-crossentropy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.BinaryCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-binary-io-u.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-binary-io-u.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.metrics.-binary-io-u.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-binary-io-u.pbtxt index 49e4ac294..1e92917c6 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-binary-io-u.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-binary-io-u.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.metrics.BinaryIoU" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-categorical-accuracy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-categorical-accuracy.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-categorical-accuracy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-categorical-accuracy.pbtxt index c56abceae..cb797237b 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-categorical-accuracy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-categorical-accuracy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.CategoricalAccuracy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt index 92d50ec7a..d4aaa3c26 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-categorical-crossentropy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.CategoricalCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-categorical-hinge.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-categorical-hinge.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-categorical-hinge.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-categorical-hinge.pbtxt index f4386171e..42c091336 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-categorical-hinge.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-categorical-hinge.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.CategoricalHinge" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-cosine-similarity.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-cosine-similarity.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-cosine-similarity.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-cosine-similarity.pbtxt index 221cbe34e..f6e28154c 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-cosine-similarity.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-cosine-similarity.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.CosineSimilarity" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-f-beta-score.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-f-beta-score.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.metrics.-f-beta-score.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-f-beta-score.pbtxt index 37847a1f9..61da1faa4 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-f-beta-score.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-f-beta-score.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.metrics.FBetaScore" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-f1-score.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-f1-score.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.metrics.-f1-score.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-f1-score.pbtxt index 56d233b0b..9ff9cb994 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-f1-score.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-f1-score.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.F1Score" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-false-negatives.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-false-negatives.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.metrics.-false-negatives.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-false-negatives.pbtxt index 12518c046..b5e002f3b 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-false-negatives.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-false-negatives.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.FalseNegatives" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-false-positives.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-false-positives.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.metrics.-false-positives.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-false-positives.pbtxt index d3a260bc7..38058d627 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-false-positives.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-false-positives.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.FalsePositives" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-hinge.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-hinge.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-hinge.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-hinge.pbtxt index c01adca8b..ffbcc6071 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-hinge.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-hinge.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.Hinge" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-io-u.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-io-u.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.metrics.-io-u.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-io-u.pbtxt index 3b3e4ed1e..ce2e9a70d 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-io-u.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-io-u.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.IoU" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-k-l-divergence.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-k-l-divergence.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-k-l-divergence.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-k-l-divergence.pbtxt index 8fe4028c9..51cdf17c7 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-k-l-divergence.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-k-l-divergence.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.KLDivergence" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-log-cosh-error.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-log-cosh-error.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-log-cosh-error.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-log-cosh-error.pbtxt index 862a2c127..3cf72f342 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-log-cosh-error.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-log-cosh-error.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.LogCoshError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-absolute-error.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-absolute-error.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-mean-absolute-error.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-absolute-error.pbtxt index 4db047358..db467fab9 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-absolute-error.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-absolute-error.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.MeanAbsoluteError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt index c1a4285ba..46c80dc84 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-absolute-percentage-error.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.MeanAbsolutePercentageError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-io-u.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-io-u.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.metrics.-mean-io-u.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-io-u.pbtxt index eb8b2c471..1ebbb6303 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-io-u.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-io-u.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.metrics.MeanIoU" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt index d84345e14..597cd1311 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-metric-wrapper.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.metrics.MeanMetricWrapper" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-relative-error.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-relative-error.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.metrics.-mean-relative-error.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-relative-error.pbtxt index 697c4e0bb..c2c475ab0 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-mean-relative-error.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-relative-error.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.metrics.MeanRelativeError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-squared-error.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-squared-error.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-mean-squared-error.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-squared-error.pbtxt index ceb5282f0..1b39d9002 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-squared-error.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-squared-error.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.MeanSquaredError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt index 2d5cf64c2..d10df5da4 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-squared-logarithmic-error.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.MeanSquaredLogarithmicError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-tensor.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-tensor.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.metrics.-mean-tensor.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-tensor.pbtxt index 6e8ba1767..eef3b0c26 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-mean-tensor.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean-tensor.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.metrics.MeanTensor" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-mean.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.metrics.-mean.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean.pbtxt index c31d49e14..859bf2b08 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-mean.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-mean.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.Mean" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-metric.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-metric.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.metrics.-metric.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-metric.pbtxt index 916ae9309..e85091fa6 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-metric.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-metric.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.metrics.Metric" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-one-hot-io-u.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-one-hot-io-u.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.metrics.-one-hot-io-u.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-one-hot-io-u.pbtxt index 23fd50224..bbe5bf507 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-one-hot-io-u.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-one-hot-io-u.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.metrics.OneHotIoU" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt index 98b63a62d..e178faa65 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-one-hot-mean-io-u.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.OneHotMeanIoU" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-poisson.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-poisson.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-poisson.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-poisson.pbtxt index 1d5f8c6ef..8ab8967a9 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-poisson.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-poisson.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.Poisson" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-precision-at-recall.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-precision-at-recall.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.metrics.-precision-at-recall.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-precision-at-recall.pbtxt index 21f1c36bd..1490978f2 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-precision-at-recall.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-precision-at-recall.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.PrecisionAtRecall" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-precision.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-precision.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.metrics.-precision.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-precision.pbtxt index d9c49540e..297fc2cec 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-precision.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-precision.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.metrics.Precision" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-r2-score.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-r2-score.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.metrics.-r2-score.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-r2-score.pbtxt index 1e76ffb29..335d51a1a 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-r2-score.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-r2-score.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.metrics.R2Score" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-recall-at-precision.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-recall-at-precision.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.metrics.-recall-at-precision.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-recall-at-precision.pbtxt index 5aa668718..2a1885cba 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-recall-at-precision.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-recall-at-precision.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.RecallAtPrecision" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-recall.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-recall.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.metrics.-recall.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-recall.pbtxt index e7c4864a1..4785c25a2 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-recall.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-recall.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.metrics.Recall" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt index 64671f63b..e7465f8d4 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-root-mean-squared-error.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.metrics.RootMeanSquaredError" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt index 9b35e4f14..ca3983ff4 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-sensitivity-at-specificity.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.SensitivityAtSpecificity" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt index d960b99ec..05e7584c2 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-sparse-categorical-accuracy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.SparseCategoricalAccuracy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt similarity index 93% rename from keras/api/golden/v1/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt index c5bd4c6f5..5ab16ab8c 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-sparse-categorical-crossentropy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.SparseCategoricalCrossentropy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt index 069a3e3b2..6eb2c4593 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-sparse-top-k-categorical-accuracy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.SparseTopKCategoricalAccuracy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt index 9f42d1f0b..9bc6e71b3 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-specificity-at-sensitivity.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.SpecificityAtSensitivity" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-squared-hinge.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-squared-hinge.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-squared-hinge.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-squared-hinge.pbtxt index 83437f332..42b20dbd3 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-squared-hinge.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-squared-hinge.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.SquaredHinge" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-sum.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-sum.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.metrics.-sum.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-sum.pbtxt index 6cb46d1f9..1dacac458 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-sum.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-sum.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.Sum" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt similarity index 93% rename from keras/api/golden/v2/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt index 6355e88e1..060258cc3 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-top-k-categorical-accuracy.pbtxt @@ -1,15 +1,15 @@ path: "tensorflow.keras.metrics.TopKCategoricalAccuracy" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-true-negatives.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-true-negatives.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.metrics.-true-negatives.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-true-negatives.pbtxt index 95bc523ab..b3e3eb95a 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-true-negatives.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-true-negatives.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.TrueNegatives" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.metrics.-true-positives.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-true-positives.pbtxt similarity index 94% rename from keras/api/golden/v1/tensorflow.keras.metrics.-true-positives.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.-true-positives.pbtxt index 863fb2911..7830f1dac 100644 --- a/keras/api/golden/v1/tensorflow.keras.metrics.-true-positives.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.-true-positives.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.metrics.TruePositives" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.experimental.-py-metric.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.experimental.-py-metric.pbtxt similarity index 96% rename from keras/api/golden/v2/tensorflow.keras.metrics.experimental.-py-metric.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.experimental.-py-metric.pbtxt index 468898868..3ec7bb2a9 100644 --- a/keras/api/golden/v2/tensorflow.keras.metrics.experimental.-py-metric.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.metrics.experimental.-py-metric.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.metrics.experimental.PyMetric" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.experimental.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.experimental.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.metrics.experimental.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.experimental.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.metrics.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.metrics.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.metrics.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.metrics.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt similarity index 89% rename from keras/api/golden/v2/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt index 50931ad79..3795f2294 100644 --- a/keras/api/golden/v2/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.mixed_precision.-loss-scale-optimizer.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.mixed_precision.LossScaleOptimizer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member { name: "dynamic" diff --git a/keras/api/golden/v2/tensorflow.keras.mixed_precision.-policy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.mixed_precision.-policy.pbtxt similarity index 91% rename from keras/api/golden/v2/tensorflow.keras.mixed_precision.-policy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.mixed_precision.-policy.pbtxt index dc2141f4f..7c91557b4 100644 --- a/keras/api/golden/v2/tensorflow.keras.mixed_precision.-policy.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.mixed_precision.-policy.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.mixed_precision.Policy" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member { name: "compute_dtype" diff --git a/keras/api/golden/v2/tensorflow.keras.mixed_precision.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.mixed_precision.pbtxt similarity index 80% rename from keras/api/golden/v2/tensorflow.keras.mixed_precision.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.mixed_precision.pbtxt index cc7748cb8..8566fcd42 100644 --- a/keras/api/golden/v2/tensorflow.keras.mixed_precision.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.mixed_precision.pbtxt @@ -2,7 +2,7 @@ path: "tensorflow.keras.mixed_precision" tf_module { member { name: "LossScaleOptimizer" - mtype: "" + mtype: "" } member { name: "Policy" diff --git a/keras/api/golden/v1/tensorflow.keras.models.-model.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.models.-model.pbtxt similarity index 98% rename from keras/api/golden/v1/tensorflow.keras.models.-model.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.models.-model.pbtxt index af5a892ca..beea74ace 100644 --- a/keras/api/golden/v1/tensorflow.keras.models.-model.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.models.-model.pbtxt @@ -1,12 +1,12 @@ path: "tensorflow.keras.models.Model" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v1/tensorflow.keras.models.-sequential.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.models.-sequential.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.models.-sequential.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.models.-sequential.pbtxt index a6f046c2e..49d4a9a43 100644 --- a/keras/api/golden/v1/tensorflow.keras.models.-sequential.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.models.-sequential.pbtxt @@ -1,14 +1,14 @@ path: "tensorflow.keras.models.Sequential" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.models.experimental.-sharpness-aware-minimization.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.models.experimental.-sharpness-aware-minimization.pbtxt similarity index 97% rename from keras/api/golden/v2/tensorflow.keras.models.experimental.-sharpness-aware-minimization.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.models.experimental.-sharpness-aware-minimization.pbtxt index 65e117c45..9c9473c9f 100644 --- a/keras/api/golden/v2/tensorflow.keras.models.experimental.-sharpness-aware-minimization.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.models.experimental.-sharpness-aware-minimization.pbtxt @@ -1,13 +1,13 @@ path: "tensorflow.keras.models.experimental.SharpnessAwareMinimization" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.models.experimental.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.models.experimental.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.models.experimental.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.models.experimental.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.models.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.models.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.models.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.models.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.-adadelta.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adadelta.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.-adadelta.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adadelta.pbtxt index bc24d928c..0b0ed5822 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.-adadelta.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adadelta.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.Adadelta" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.-adafactor.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adafactor.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.-adafactor.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adafactor.pbtxt index fb3952d2b..3545de528 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.-adafactor.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adafactor.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.Adafactor" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.-adagrad.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adagrad.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.-adagrad.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adagrad.pbtxt index 4e6b8a679..9df23bd2a 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.-adagrad.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adagrad.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.Adagrad" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.-adam-w.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adam-w.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.-adam-w.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adam-w.pbtxt index 12b154892..dccaa8428 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.-adam-w.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adam-w.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.AdamW" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.-adam.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adam.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.-adam.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adam.pbtxt index 978f3b874..611c78a1a 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.-adam.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adam.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.Adam" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.-adamax.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adamax.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.-adamax.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adamax.pbtxt index 302da145c..255286331 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.-adamax.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-adamax.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.Adamax" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.-ftrl.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-ftrl.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.-ftrl.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.-ftrl.pbtxt index be804558c..4b22a7a45 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.-ftrl.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-ftrl.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.Ftrl" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.-lion.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-lion.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.-lion.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.-lion.pbtxt index 5d4faf415..ff5968455 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.-lion.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-lion.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.Lion" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.-nadam.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-nadam.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.-nadam.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.-nadam.pbtxt index b6c91c10e..7d37dd1e2 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.-nadam.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-nadam.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.Nadam" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.-optimizer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-optimizer.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.optimizers.-optimizer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.-optimizer.pbtxt index d30f25489..6451aa1a9 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.-optimizer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-optimizer.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.Optimizer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.-r-m-sprop.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-r-m-sprop.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.-r-m-sprop.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.-r-m-sprop.pbtxt index 9bcb35ea7..f0dd81f73 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.-r-m-sprop.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-r-m-sprop.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.RMSprop" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.-s-g-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-s-g-d.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.-s-g-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.-s-g-d.pbtxt index 73dc46d85..5f1b59616 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.-s-g-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.-s-g-d.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.SGD" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adadelta.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adadelta.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adadelta.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adadelta.pbtxt index 2ada86ac0..7ee4313e7 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adadelta.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adadelta.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.experimental.Adadelta" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adafactor.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adafactor.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adafactor.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adafactor.pbtxt index 30a77095a..86e9f1baf 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adafactor.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adafactor.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.experimental.Adafactor" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adagrad.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adagrad.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adagrad.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adagrad.pbtxt index bcdc12926..41708132d 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adagrad.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adagrad.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.experimental.Adagrad" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam-w.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam-w.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam-w.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam-w.pbtxt index 240e92cf9..4af325afc 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam-w.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam-w.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.experimental.AdamW" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam.pbtxt index a36751778..9913baad7 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adam.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.experimental.Adam" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adamax.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adamax.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adamax.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adamax.pbtxt index f8b070a6b..b024b1a3a 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adamax.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-adamax.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.experimental.Adamax" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-ftrl.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-ftrl.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-ftrl.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-ftrl.pbtxt index 892d407e8..63d0b176c 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-ftrl.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-ftrl.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.experimental.Ftrl" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-nadam.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-nadam.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-nadam.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-nadam.pbtxt index 887e8bb52..29f91a442 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-nadam.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-nadam.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.experimental.Nadam" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-optimizer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-optimizer.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-optimizer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-optimizer.pbtxt index f4a84d454..cd387683b 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-optimizer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-optimizer.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.experimental.Optimizer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-r-m-sprop.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-r-m-sprop.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-r-m-sprop.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-r-m-sprop.pbtxt index c8998cffc..d874e9bfc 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-r-m-sprop.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-r-m-sprop.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.experimental.RMSprop" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-s-g-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-s-g-d.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-s-g-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-s-g-d.pbtxt index 7a73dc7f4..8cf868232 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-s-g-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.-s-g-d.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.optimizers.experimental.SGD" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.experimental.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.optimizers.experimental.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.experimental.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt index 05ae2888d..528567153 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adadelta.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.Adadelta" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt index 507148f08..d4fb50974 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adagrad.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.Adagrad" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adam.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adam.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adam.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adam.pbtxt index d79093442..07917a64c 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adam.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adam.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.Adam" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adamax.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adamax.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adamax.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adamax.pbtxt index b18db0316..226f97c05 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-adamax.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-adamax.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.Adamax" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt index b852c98df..44dafcb30 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-ftrl.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.Ftrl" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-nadam.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-nadam.pbtxt similarity index 95% rename from keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-nadam.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-nadam.pbtxt index ef505faad..3e579154c 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-nadam.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-nadam.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.Nadam" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt similarity index 97% rename from keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt index f28c01037..de3e1f12a 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-optimizer.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.optimizers.legacy.Optimizer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt similarity index 95% rename from keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt index f53b0568f..0c274c7ee 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-r-m-sprop.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.RMSprop" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt similarity index 94% rename from keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt index ab1041592..b525c6540 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.-s-g-d.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.legacy.SGD" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" member { diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.legacy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.optimizers.legacy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.legacy.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.optimizers.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt similarity index 74% rename from keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt index 16daa97b8..ce4fdbf11 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay-restarts.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.schedules.CosineDecayRestarts" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt similarity index 75% rename from keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt index 6df561f33..b89865e52 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-cosine-decay.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.schedules.CosineDecay" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt similarity index 74% rename from keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt index c38633e5a..07cf7a115 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-exponential-decay.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.schedules.ExponentialDecay" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt similarity index 74% rename from keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt index 56f6937bb..25c40c9a9 100644 --- a/keras/api/golden/v1/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-inverse-time-decay.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.schedules.InverseTimeDecay" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt similarity index 79% rename from keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt index 243f00aba..cee3d2373 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-learning-rate-schedule.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.optimizers.schedules.LearningRateSchedule" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt similarity index 71% rename from keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt index f5ceeb326..a611f2d84 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-piecewise-constant-decay.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.schedules.PiecewiseConstantDecay" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt similarity index 75% rename from keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt index fb2000072..a50220198 100644 --- a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.-polynomial-decay.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.optimizers.schedules.PolynomialDecay" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.optimizers.schedules.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.optimizers.schedules.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.optimizers.schedules.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt similarity index 85% rename from keras/api/golden/v1/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt index e584a165e..291061dd5 100644 --- a/keras/api/golden/v1/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.-directory-iterator.pbtxt @@ -1,9 +1,9 @@ path: "tensorflow.keras.preprocessing.image.DirectoryIterator" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "allowed_class_modes" diff --git a/keras/api/golden/v2/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt similarity index 97% rename from keras/api/golden/v2/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt index 200135f90..0f26fdc80 100644 --- a/keras/api/golden/v2/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.-image-data-generator.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.preprocessing.image.ImageDataGenerator" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.preprocessing.image.-iterator.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.-iterator.pbtxt similarity index 84% rename from keras/api/golden/v2/tensorflow.keras.preprocessing.image.-iterator.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.-iterator.pbtxt index 94b1da3b7..ec3738727 100644 --- a/keras/api/golden/v2/tensorflow.keras.preprocessing.image.-iterator.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.-iterator.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.preprocessing.image.Iterator" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "white_list_formats" diff --git a/keras/api/golden/v1/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt similarity index 82% rename from keras/api/golden/v1/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt index c5dbf052f..e5761898c 100644 --- a/keras/api/golden/v1/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.-numpy-array-iterator.pbtxt @@ -1,8 +1,8 @@ path: "tensorflow.keras.preprocessing.image.NumpyArrayIterator" tf_class { - is_instance: "" - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member { name: "white_list_formats" diff --git a/keras/api/golden/v2/tensorflow.keras.preprocessing.image.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.preprocessing.image.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.preprocessing.image.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.preprocessing.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.preprocessing.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.preprocessing.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt similarity index 84% rename from keras/api/golden/v2/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt index 1e99d483a..e5361134c 100644 --- a/keras/api/golden/v2/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.sequence.-timeseries-generator.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.preprocessing.sequence.TimeseriesGenerator" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.preprocessing.sequence.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.sequence.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.preprocessing.sequence.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.preprocessing.sequence.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt similarity index 96% rename from keras/api/golden/v1/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt index 2e841daf0..a2c0ac766 100644 --- a/keras/api/golden/v1/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.text.-tokenizer.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.preprocessing.text.Tokenizer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.preprocessing.text.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.preprocessing.text.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.preprocessing.text.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.preprocessing.text.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.regularizers.-l1-l2.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.-l1-l2.pbtxt similarity index 80% rename from keras/api/golden/v2/tensorflow.keras.regularizers.-l1-l2.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.regularizers.-l1-l2.pbtxt index b704de99c..6cd4521da 100644 --- a/keras/api/golden/v2/tensorflow.keras.regularizers.-l1-l2.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.-l1-l2.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.regularizers.L1L2" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.regularizers.-l1.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.-l1.pbtxt similarity index 80% rename from keras/api/golden/v2/tensorflow.keras.regularizers.-l1.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.regularizers.-l1.pbtxt index 31d5659bd..f5fa8ad43 100644 --- a/keras/api/golden/v2/tensorflow.keras.regularizers.-l1.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.-l1.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.regularizers.L1" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.regularizers.-l2.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.-l2.pbtxt similarity index 80% rename from keras/api/golden/v1/tensorflow.keras.regularizers.-l2.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.regularizers.-l2.pbtxt index 5253aec0f..ef26014de 100644 --- a/keras/api/golden/v1/tensorflow.keras.regularizers.-l2.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.-l2.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.regularizers.L2" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.regularizers.-orthogonal-regularizer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.-orthogonal-regularizer.pbtxt similarity index 79% rename from keras/api/golden/v2/tensorflow.keras.regularizers.-orthogonal-regularizer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.regularizers.-orthogonal-regularizer.pbtxt index 9281bb956..8f1947add 100644 --- a/keras/api/golden/v2/tensorflow.keras.regularizers.-orthogonal-regularizer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.-orthogonal-regularizer.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.regularizers.OrthogonalRegularizer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.regularizers.-regularizer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.-regularizer.pbtxt similarity index 86% rename from keras/api/golden/v2/tensorflow.keras.regularizers.-regularizer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.regularizers.-regularizer.pbtxt index 4a7bbb34f..ac794f9e9 100644 --- a/keras/api/golden/v2/tensorflow.keras.regularizers.-regularizer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.-regularizer.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.regularizers.Regularizer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.regularizers.l1.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.l1.pbtxt similarity index 80% rename from keras/api/golden/v2/tensorflow.keras.regularizers.l1.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.regularizers.l1.pbtxt index b3c5b3dfd..6587f26d2 100644 --- a/keras/api/golden/v2/tensorflow.keras.regularizers.l1.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.l1.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.regularizers.l1" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.regularizers.l2.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.l2.pbtxt similarity index 80% rename from keras/api/golden/v1/tensorflow.keras.regularizers.l2.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.regularizers.l2.pbtxt index 4db49bd44..d32de838e 100644 --- a/keras/api/golden/v1/tensorflow.keras.regularizers.l2.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.l2.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.regularizers.l2" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.regularizers.orthogonal_regularizer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.orthogonal_regularizer.pbtxt similarity index 79% rename from keras/api/golden/v2/tensorflow.keras.regularizers.orthogonal_regularizer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.regularizers.orthogonal_regularizer.pbtxt index 4b1f0df10..03319a916 100644 --- a/keras/api/golden/v2/tensorflow.keras.regularizers.orthogonal_regularizer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.orthogonal_regularizer.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.regularizers.orthogonal_regularizer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.regularizers.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.regularizers.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.regularizers.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.regularizers.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.saving.custom_object_scope.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.saving.custom_object_scope.pbtxt similarity index 72% rename from keras/api/golden/v1/tensorflow.keras.saving.custom_object_scope.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.saving.custom_object_scope.pbtxt index cf877e5ae..c03beb677 100644 --- a/keras/api/golden/v1/tensorflow.keras.saving.custom_object_scope.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.saving.custom_object_scope.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.saving.custom_object_scope" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.saving.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.saving.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.saving.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.saving.pbtxt diff --git a/keras/api/golden/v1/tensorflow.keras.utils.-custom-object-scope.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.-custom-object-scope.pbtxt similarity index 72% rename from keras/api/golden/v1/tensorflow.keras.utils.-custom-object-scope.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.-custom-object-scope.pbtxt index 3ccf719d8..f88357a3e 100644 --- a/keras/api/golden/v1/tensorflow.keras.utils.-custom-object-scope.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.utils.-custom-object-scope.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.CustomObjectScope" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.utils.-feature-space.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.-feature-space.pbtxt similarity index 97% rename from keras/api/golden/v2/tensorflow.keras.utils.-feature-space.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.-feature-space.pbtxt index 1ae0313d8..c194e5f12 100644 --- a/keras/api/golden/v2/tensorflow.keras.utils.-feature-space.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.utils.-feature-space.pbtxt @@ -1,11 +1,11 @@ path: "tensorflow.keras.utils.FeatureSpace" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" is_instance: "" is_instance: "" - is_instance: "" + is_instance: "" is_instance: "" member { name: "activity_regularizer" diff --git a/keras/api/golden/v2/tensorflow.keras.utils.-generator-enqueuer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.-generator-enqueuer.pbtxt similarity index 84% rename from keras/api/golden/v2/tensorflow.keras.utils.-generator-enqueuer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.-generator-enqueuer.pbtxt index ac1c5387b..e244c5b25 100644 --- a/keras/api/golden/v2/tensorflow.keras.utils.-generator-enqueuer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.utils.-generator-enqueuer.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.utils.GeneratorEnqueuer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.utils.-ordered-enqueuer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.-ordered-enqueuer.pbtxt similarity index 85% rename from keras/api/golden/v1/tensorflow.keras.utils.-ordered-enqueuer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.-ordered-enqueuer.pbtxt index 9cd4b730b..d93a85d10 100644 --- a/keras/api/golden/v1/tensorflow.keras.utils.-ordered-enqueuer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.utils.-ordered-enqueuer.pbtxt @@ -1,7 +1,7 @@ path: "tensorflow.keras.utils.OrderedEnqueuer" tf_class { - is_instance: "" - is_instance: "" + is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.utils.-progbar.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.-progbar.pbtxt similarity index 90% rename from keras/api/golden/v2/tensorflow.keras.utils.-progbar.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.-progbar.pbtxt index a1b31c038..291771d17 100644 --- a/keras/api/golden/v2/tensorflow.keras.utils.-progbar.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.utils.-progbar.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.Progbar" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.utils.-sequence-enqueuer.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.-sequence-enqueuer.pbtxt similarity index 91% rename from keras/api/golden/v2/tensorflow.keras.utils.-sequence-enqueuer.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.-sequence-enqueuer.pbtxt index eb3bbc5b8..62980ea43 100644 --- a/keras/api/golden/v2/tensorflow.keras.utils.-sequence-enqueuer.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.utils.-sequence-enqueuer.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.SequenceEnqueuer" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.utils.-sequence.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.-sequence.pbtxt similarity index 79% rename from keras/api/golden/v1/tensorflow.keras.utils.-sequence.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.-sequence.pbtxt index 43e0717cc..498848d25 100644 --- a/keras/api/golden/v1/tensorflow.keras.utils.-sequence.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.utils.-sequence.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.Sequence" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.utils.-sidecar-evaluator.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.-sidecar-evaluator.pbtxt similarity index 84% rename from keras/api/golden/v2/tensorflow.keras.utils.-sidecar-evaluator.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.-sidecar-evaluator.pbtxt index 1d3a83fa5..6ec61c8ce 100644 --- a/keras/api/golden/v2/tensorflow.keras.utils.-sidecar-evaluator.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.utils.-sidecar-evaluator.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.SidecarEvaluator" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt similarity index 87% rename from keras/api/golden/v1/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt index 1363d2190..8f330282b 100644 --- a/keras/api/golden/v1/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.utils.-steps-per-execution-tuner.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.StepsPerExecutionTuner" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member { name: "steps_per_execution" diff --git a/keras/api/golden/v2/tensorflow.keras.utils.-timed-thread.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.-timed-thread.pbtxt similarity index 90% rename from keras/api/golden/v2/tensorflow.keras.utils.-timed-thread.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.-timed-thread.pbtxt index bd3947c59..18eedae9c 100644 --- a/keras/api/golden/v2/tensorflow.keras.utils.-timed-thread.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.utils.-timed-thread.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.TimedThread" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v1/tensorflow.keras.utils.custom_object_scope.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.custom_object_scope.pbtxt similarity index 72% rename from keras/api/golden/v1/tensorflow.keras.utils.custom_object_scope.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.custom_object_scope.pbtxt index 08f84e0f8..4867aa1ae 100644 --- a/keras/api/golden/v1/tensorflow.keras.utils.custom_object_scope.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.utils.custom_object_scope.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.custom_object_scope" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.utils.experimental.-dataset-creator.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.experimental.-dataset-creator.pbtxt similarity index 78% rename from keras/api/golden/v2/tensorflow.keras.utils.experimental.-dataset-creator.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.experimental.-dataset-creator.pbtxt index 1db6fa5c6..a3b9cb0ed 100644 --- a/keras/api/golden/v2/tensorflow.keras.utils.experimental.-dataset-creator.pbtxt +++ b/tf_keras/api/golden/v2/tensorflow.keras.utils.experimental.-dataset-creator.pbtxt @@ -1,6 +1,6 @@ path: "tensorflow.keras.utils.experimental.DatasetCreator" tf_class { - is_instance: "" + is_instance: "" is_instance: "" member_method { name: "__init__" diff --git a/keras/api/golden/v2/tensorflow.keras.utils.experimental.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.experimental.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.utils.experimental.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.experimental.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.utils.legacy.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.legacy.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.utils.legacy.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.legacy.pbtxt diff --git a/keras/api/golden/v2/tensorflow.keras.utils.pbtxt b/tf_keras/api/golden/v2/tensorflow.keras.utils.pbtxt similarity index 100% rename from keras/api/golden/v2/tensorflow.keras.utils.pbtxt rename to tf_keras/api/golden/v2/tensorflow.keras.utils.pbtxt diff --git a/keras/api/tests/API_UPDATE_WARNING.txt b/tf_keras/api/tests/API_UPDATE_WARNING.txt similarity index 100% rename from keras/api/tests/API_UPDATE_WARNING.txt rename to tf_keras/api/tests/API_UPDATE_WARNING.txt diff --git a/keras/api/tests/BUILD b/tf_keras/api/tests/BUILD similarity index 68% rename from keras/api/tests/BUILD rename to tf_keras/api/tests/BUILD index 951ec210e..06e6e50a0 100644 --- a/keras/api/tests/BUILD +++ b/tf_keras/api/tests/BUILD @@ -1,10 +1,10 @@ # TensorFlow API backwards compatibility tests. -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], - default_visibility = ["//keras/api:__subpackages__"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], + default_visibility = ["//tf_keras/api:__subpackages__"], licenses = ["notice"], # Apache 2.0 ) @@ -17,10 +17,10 @@ tf_py_test( name = "api_compatibility_test", srcs = ["api_compatibility_test.py"], data = [ - "//keras/api/golden:api_golden_v1", - "//keras/api/golden:api_golden_v2", - "//keras/api/tests:API_UPDATE_WARNING.txt", - "//keras/api/tests:README.txt", + "//tf_keras/api/golden:api_golden_v1", + "//tf_keras/api/golden:api_golden_v2", + "//tf_keras/api/tests:API_UPDATE_WARNING.txt", + "//tf_keras/api/tests:README.txt", ], python_version = "PY3", srcs_version = "PY3", diff --git a/keras/api/tests/README.txt b/tf_keras/api/tests/README.txt similarity index 100% rename from keras/api/tests/README.txt rename to tf_keras/api/tests/README.txt diff --git a/keras/api/tests/api_compatibility_test.py b/tf_keras/api/tests/api_compatibility_test.py similarity index 99% rename from keras/api/tests/api_compatibility_test.py rename to tf_keras/api/tests/api_compatibility_test.py index 10e31601a..8bbe19f57 100644 --- a/keras/api/tests/api_compatibility_test.py +++ b/tf_keras/api/tests/api_compatibility_test.py @@ -15,12 +15,12 @@ # ============================================================================== """Keras API compatibility tests. -This test ensures all changes to the public API of Keras are intended. +This test ensures all changes to the public API of TF-Keras are intended. If this test fails, it means a change has been made to the public API. Backwards incompatible changes are not allowed. You can run the test with "--update_goldens" flag set to "True" to update goldens when making changes to -the public Keras python API. +the public TF-Keras python API. """ from __future__ import absolute_import diff --git a/keras/applications/BUILD b/tf_keras/applications/BUILD similarity index 76% rename from keras/applications/BUILD rename to tf_keras/applications/BUILD index 90969468e..6cc8ab2e7 100644 --- a/keras/applications/BUILD +++ b/tf_keras/applications/BUILD @@ -1,14 +1,14 @@ # Description: -# Contains the Keras Application package (internal TensorFlow version). +# Contains the TF-Keras Application package (internal TensorFlow version). # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ # Remove this deps to integration test. - "//keras:friends", + "//tf_keras:friends", ], licenses = ["notice"], ) @@ -41,13 +41,13 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:backend", - "//keras/engine", - "//keras/layers", - "//keras/models", - "//keras/utils:data_utils", - "//keras/utils:layer_utils", + "//tf_keras:activations", + "//tf_keras:backend", + "//tf_keras/engine", + "//tf_keras/layers", + "//tf_keras/models", + "//tf_keras/utils:data_utils", + "//tf_keras/utils:layer_utils", ], ) @@ -63,9 +63,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -86,9 +86,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -105,9 +105,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -123,9 +123,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -141,9 +141,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -159,9 +159,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -177,9 +177,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -195,9 +195,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -213,9 +213,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -231,9 +231,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -249,9 +249,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -267,9 +267,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -285,9 +285,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -304,9 +304,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -323,9 +323,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -342,9 +342,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -360,9 +360,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -378,9 +378,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -396,9 +396,9 @@ tf_py_test( ], deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/preprocessing", + "//tf_keras/preprocessing", ], ) @@ -409,9 +409,9 @@ tf_py_test( shard_count = 2, deps = [ ":applications", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/tf_keras/applications/__init__.py b/tf_keras/applications/__init__.py new file mode 100644 index 000000000..e0a9dc577 --- /dev/null +++ b/tf_keras/applications/__init__.py @@ -0,0 +1,64 @@ +# Copyright 2016 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. +# ============================================================================== +"""Keras Applications are premade architectures with pre-trained weights.""" + + +from tf_keras.applications.convnext import ConvNeXtBase +from tf_keras.applications.convnext import ConvNeXtLarge +from tf_keras.applications.convnext import ConvNeXtSmall +from tf_keras.applications.convnext import ConvNeXtTiny +from tf_keras.applications.convnext import ConvNeXtXLarge +from tf_keras.applications.densenet import DenseNet121 +from tf_keras.applications.densenet import DenseNet169 +from tf_keras.applications.densenet import DenseNet201 +from tf_keras.applications.efficientnet import EfficientNetB0 +from tf_keras.applications.efficientnet import EfficientNetB1 +from tf_keras.applications.efficientnet import EfficientNetB2 +from tf_keras.applications.efficientnet import EfficientNetB3 +from tf_keras.applications.efficientnet import EfficientNetB4 +from tf_keras.applications.efficientnet import EfficientNetB5 +from tf_keras.applications.efficientnet import EfficientNetB6 +from tf_keras.applications.efficientnet import EfficientNetB7 +from tf_keras.applications.efficientnet_v2 import EfficientNetV2B0 +from tf_keras.applications.efficientnet_v2 import EfficientNetV2B1 +from tf_keras.applications.efficientnet_v2 import EfficientNetV2B2 +from tf_keras.applications.efficientnet_v2 import EfficientNetV2B3 +from tf_keras.applications.efficientnet_v2 import EfficientNetV2L +from tf_keras.applications.efficientnet_v2 import EfficientNetV2M +from tf_keras.applications.efficientnet_v2 import EfficientNetV2S +from tf_keras.applications.inception_resnet_v2 import InceptionResNetV2 +from tf_keras.applications.inception_v3 import InceptionV3 +from tf_keras.applications.mobilenet import MobileNet +from tf_keras.applications.mobilenet_v2 import MobileNetV2 +from tf_keras.applications.mobilenet_v3 import MobileNetV3Large +from tf_keras.applications.mobilenet_v3 import MobileNetV3Small +from tf_keras.applications.nasnet import NASNetLarge +from tf_keras.applications.nasnet import NASNetMobile +from tf_keras.applications.resnet import ResNet50 +from tf_keras.applications.resnet import ResNet101 +from tf_keras.applications.resnet import ResNet152 +from tf_keras.applications.resnet_rs import ResNetRS50 +from tf_keras.applications.resnet_rs import ResNetRS101 +from tf_keras.applications.resnet_rs import ResNetRS152 +from tf_keras.applications.resnet_rs import ResNetRS200 +from tf_keras.applications.resnet_rs import ResNetRS270 +from tf_keras.applications.resnet_rs import ResNetRS350 +from tf_keras.applications.resnet_rs import ResNetRS420 +from tf_keras.applications.resnet_v2 import ResNet50V2 +from tf_keras.applications.resnet_v2 import ResNet101V2 +from tf_keras.applications.resnet_v2 import ResNet152V2 +from tf_keras.applications.vgg16 import VGG16 +from tf_keras.applications.vgg19 import VGG19 +from tf_keras.applications.xception import Xception diff --git a/keras/applications/applications_load_weight_test.py b/tf_keras/applications/applications_load_weight_test.py similarity index 87% rename from keras/applications/applications_load_weight_test.py rename to tf_keras/applications/applications_load_weight_test.py index 875f0e4cd..9b383a3ca 100644 --- a/keras/applications/applications_load_weight_test.py +++ b/tf_keras/applications/applications_load_weight_test.py @@ -12,32 +12,32 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Integration tests for Keras applications.""" +"""Integration tests for TF-Keras applications.""" import numpy as np import tensorflow.compat.v2 as tf from absl import flags from absl.testing import parameterized -from keras.applications import convnext -from keras.applications import densenet -from keras.applications import efficientnet -from keras.applications import efficientnet_v2 -from keras.applications import inception_resnet_v2 -from keras.applications import inception_v3 -from keras.applications import mobilenet -from keras.applications import mobilenet_v2 -from keras.applications import mobilenet_v3 -from keras.applications import nasnet -from keras.applications import regnet -from keras.applications import resnet -from keras.applications import resnet_rs -from keras.applications import resnet_v2 -from keras.applications import vgg16 -from keras.applications import vgg19 -from keras.applications import xception -from keras.utils import data_utils -from keras.utils import image_utils +from tf_keras.applications import convnext +from tf_keras.applications import densenet +from tf_keras.applications import efficientnet +from tf_keras.applications import efficientnet_v2 +from tf_keras.applications import inception_resnet_v2 +from tf_keras.applications import inception_v3 +from tf_keras.applications import mobilenet +from tf_keras.applications import mobilenet_v2 +from tf_keras.applications import mobilenet_v3 +from tf_keras.applications import nasnet +from tf_keras.applications import regnet +from tf_keras.applications import resnet +from tf_keras.applications import resnet_rs +from tf_keras.applications import resnet_v2 +from tf_keras.applications import vgg16 +from tf_keras.applications import vgg19 +from tf_keras.applications import xception +from tf_keras.utils import data_utils +from tf_keras.utils import image_utils ARG_TO_MODEL = { "resnet": (resnet, [resnet.ResNet50, resnet.ResNet101, resnet.ResNet152]), diff --git a/keras/applications/applications_test.py b/tf_keras/applications/applications_test.py similarity index 90% rename from keras/applications/applications_test.py rename to tf_keras/applications/applications_test.py index d74ae95ec..b4858f2ed 100644 --- a/keras/applications/applications_test.py +++ b/tf_keras/applications/applications_test.py @@ -12,33 +12,33 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Integration tests for Keras applications.""" +"""Integration tests for TF-Keras applications.""" import os import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import backend -from keras import utils -from keras.applications import convnext -from keras.applications import densenet -from keras.applications import efficientnet -from keras.applications import efficientnet_v2 -from keras.applications import inception_resnet_v2 -from keras.applications import inception_v3 -from keras.applications import mobilenet -from keras.applications import mobilenet_v2 -from keras.applications import mobilenet_v3 -from keras.applications import nasnet -from keras.applications import regnet -from keras.applications import resnet -from keras.applications import resnet_rs -from keras.applications import resnet_v2 -from keras.applications import vgg16 -from keras.applications import vgg19 -from keras.applications import xception -from keras.testing_infra import test_utils +from tf_keras import backend +from tf_keras import utils +from tf_keras.applications import convnext +from tf_keras.applications import densenet +from tf_keras.applications import efficientnet +from tf_keras.applications import efficientnet_v2 +from tf_keras.applications import inception_resnet_v2 +from tf_keras.applications import inception_v3 +from tf_keras.applications import mobilenet +from tf_keras.applications import mobilenet_v2 +from tf_keras.applications import mobilenet_v3 +from tf_keras.applications import nasnet +from tf_keras.applications import regnet +from tf_keras.applications import resnet +from tf_keras.applications import resnet_rs +from tf_keras.applications import resnet_v2 +from tf_keras.applications import vgg16 +from tf_keras.applications import vgg19 +from tf_keras.applications import xception +from tf_keras.testing_infra import test_utils MODEL_LIST_NO_NASNET = [ (resnet.ResNet50, 2048), diff --git a/keras/applications/convnext.py b/tf_keras/applications/convnext.py similarity index 97% rename from keras/applications/convnext.py rename to tf_keras/applications/convnext.py index 829466a63..109dd2eb5 100644 --- a/keras/applications/convnext.py +++ b/tf_keras/applications/convnext.py @@ -14,7 +14,7 @@ # ============================================================================== -"""ConvNeXt models for Keras. +"""ConvNeXt models for TF-Keras. References: @@ -25,13 +25,13 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import initializers -from keras import layers -from keras import utils -from keras.applications import imagenet_utils -from keras.engine import sequential -from keras.engine import training as training_lib +from tf_keras import backend +from tf_keras import initializers +from tf_keras import layers +from tf_keras import utils +from tf_keras.applications import imagenet_utils +from tf_keras.engine import sequential +from tf_keras.engine import training as training_lib # isort: off from tensorflow.python.util.tf_export import keras_export @@ -109,11 +109,11 @@ ImageNet-21k dataset and then fine-tuned on the ImageNet-1k dataset. The pre-trained parameters of the models were assembled from the [official repository](https://github.com/facebookresearch/ConvNeXt). To get a - sense of how these parameters were converted to Keras compatible parameters, + sense of how these parameters were converted to TF-Keras compatible parameters, please refer to [this repository](https://github.com/sayakpaul/keras-convnext-conversion). - Note: Each Keras Application expects a specific kind of input preprocessing. + Note: Each TF-Keras Application expects a specific kind of input preprocessing. For ConvNeXt, preprocessing is included in the model using a `Normalization` layer. ConvNeXt models expect their inputs to be float or uint8 tensors of pixels with values in the [0-255] range. @@ -128,7 +128,7 @@ weights: One of `None` (random initialization), `"imagenet"` (pre-training on ImageNet-1k), or the path to the weights file to be loaded. Defaults to `"imagenet"`. - input_tensor: Optional Keras tensor + input_tensor: Optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: Optional shape tuple, only to be specified @@ -393,7 +393,7 @@ def ConvNeXt( the model. weights: one of `None` (random initialization), `"imagenet"` (pre-training on ImageNet-1k), or the path to the weights file to be loaded. - input_tensor: optional Keras tensor (i.e. output of `layers.Input()`) to + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified if `include_top` is False. It should have exactly 3 inputs channels. diff --git a/keras/applications/densenet.py b/tf_keras/applications/densenet.py similarity index 95% rename from keras/applications/densenet.py rename to tf_keras/applications/densenet.py index 57372d6a1..f1dc997b8 100644 --- a/keras/applications/densenet.py +++ b/tf_keras/applications/densenet.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== -"""DenseNet models for Keras. +"""DenseNet models for TF-Keras. Reference: - [Densely Connected Convolutional Networks]( @@ -22,12 +22,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.applications import imagenet_utils -from keras.engine import training -from keras.layers import VersionAwareLayers -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.layers import VersionAwareLayers +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -148,7 +148,7 @@ def DenseNet( - [Densely Connected Convolutional Networks]( https://arxiv.org/abs/1608.06993) (CVPR 2017) - This function returns a Keras image classification model, + This function returns a TF-Keras image classification model, optionally loaded with weights pre-trained on ImageNet. For image classification use cases, see @@ -159,7 +159,7 @@ def DenseNet( [guide to transfer learning & fine-tuning]( https://keras.io/guides/transfer_learning/). - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For DenseNet, call `tf.keras.applications.densenet.preprocess_input` on your inputs before passing them to the model. `densenet.preprocess_input` will scale pixels between 0 and 1 and then @@ -172,7 +172,7 @@ def DenseNet( weights: one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: optional Keras tensor + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified @@ -444,9 +444,9 @@ def decode_predictions(preds, top=5): Optionally loads weights pre-trained on ImageNet. Note that the data format convention used by the model is - the one specified in your Keras config at `~/.keras/keras.json`. + the one specified in your TF-Keras config at `~/.keras/keras.json`. - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For DenseNet, call `tf.keras.applications.densenet.preprocess_input` on your inputs before passing them to the model. @@ -456,7 +456,7 @@ def decode_predictions(preds, top=5): weights: one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: optional Keras tensor (i.e. output of `layers.Input()`) + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified if `include_top` is False (otherwise the input shape @@ -486,7 +486,7 @@ def decode_predictions(preds, top=5): be `None` or `"softmax"`. Returns: - A Keras model instance. + A TF-Keras model instance. """ setattr(DenseNet121, "__doc__", DenseNet121.__doc__ + DOC) diff --git a/keras/applications/efficientnet.py b/tf_keras/applications/efficientnet.py similarity index 98% rename from keras/applications/efficientnet.py rename to tf_keras/applications/efficientnet.py index a7d9639eb..063d9a372 100644 --- a/keras/applications/efficientnet.py +++ b/tf_keras/applications/efficientnet.py @@ -14,7 +14,7 @@ # ============================================================================== -"""EfficientNet models for Keras. +"""EfficientNet models for TF-Keras. Reference: - [EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks]( @@ -26,12 +26,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.applications import imagenet_utils -from keras.engine import training -from keras.layers import VersionAwareLayers -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.layers import VersionAwareLayers +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -172,7 +172,7 @@ - [EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks]( https://arxiv.org/abs/1905.11946) (ICML 2019) - This function returns a Keras image classification model, + This function returns a TF-Keras image classification model, optionally loaded with weights pre-trained on ImageNet. For image classification use cases, see @@ -183,7 +183,7 @@ [guide to transfer learning & fine-tuning]( https://keras.io/guides/transfer_learning/). - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For EfficientNet, input preprocessing is included as part of the model (as a `Rescaling` layer), and thus `tf.keras.applications.efficientnet.preprocess_input` is actually a @@ -196,7 +196,7 @@ weights: One of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. Defaults to 'imagenet'. - input_tensor: Optional Keras tensor + input_tensor: Optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: Optional shape tuple, only to be specified @@ -267,7 +267,7 @@ def EfficientNet( weights: one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: optional Keras tensor + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified diff --git a/keras/applications/efficientnet_v2.py b/tf_keras/applications/efficientnet_v2.py similarity index 98% rename from keras/applications/efficientnet_v2.py rename to tf_keras/applications/efficientnet_v2.py index 2d309e757..dd622aa59 100644 --- a/keras/applications/efficientnet_v2.py +++ b/tf_keras/applications/efficientnet_v2.py @@ -14,7 +14,7 @@ # ============================================================================== -"""EfficientNet V2 models for Keras. +"""EfficientNet V2 models for TF-Keras. Reference: - [EfficientNetV2: Smaller Models and Faster Training]( @@ -26,12 +26,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras import layers -from keras.applications import imagenet_utils -from keras.engine import training -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras import layers +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -550,7 +550,7 @@ - [EfficientNetV2: Smaller Models and Faster Training]( https://arxiv.org/abs/2104.00298) (ICML 2021) - This function returns a Keras image classification model, + This function returns a TF-Keras image classification model, optionally loaded with weights pre-trained on ImageNet. For image classification use cases, see @@ -561,7 +561,7 @@ [guide to transfer learning & fine-tuning]( https://keras.io/guides/transfer_learning/). - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For EfficientNetV2, by default input preprocessing is included as a part of the model (as a `Rescaling` layer), and thus `tf.keras.applications.efficientnet_v2.preprocess_input` is actually a @@ -578,7 +578,7 @@ weights: One of `None` (random initialization), `"imagenet"` (pre-training on ImageNet), or the path to the weights file to be loaded. Defaults to `"imagenet"`. - input_tensor: Optional Keras tensor + input_tensor: Optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: Optional shape tuple, only to be specified @@ -887,7 +887,7 @@ def EfficientNetV2( the network. weights: one of `None` (random initialization), `"imagenet"` (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: optional Keras tensor (i.e. output of `layers.Input()`) or + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) or numpy array to use as image input for the model. input_shape: optional shape tuple, only to be specified if `include_top` is False. It should have exactly 3 inputs channels. diff --git a/keras/applications/imagenet_utils.py b/tf_keras/applications/imagenet_utils.py similarity index 99% rename from keras/applications/imagenet_utils.py rename to tf_keras/applications/imagenet_utils.py index 3aafbad0a..4cc0f1dfa 100644 --- a/keras/applications/imagenet_utils.py +++ b/tf_keras/applications/imagenet_utils.py @@ -19,9 +19,9 @@ import numpy as np -from keras import activations -from keras import backend -from keras.utils import data_utils +from tf_keras import activations +from tf_keras import backend +from tf_keras.utils import data_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/applications/imagenet_utils_test.py b/tf_keras/applications/imagenet_utils_test.py similarity index 98% rename from keras/applications/imagenet_utils_test.py rename to tf_keras/applications/imagenet_utils_test.py index 8369884ee..07c832320 100644 --- a/keras/applications/imagenet_utils_test.py +++ b/tf_keras/applications/imagenet_utils_test.py @@ -18,10 +18,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.applications import imagenet_utils as utils -from keras.mixed_precision.policy import set_global_policy -from keras.testing_infra import test_combinations +import tf_keras as keras +from tf_keras.applications import imagenet_utils as utils +from tf_keras.mixed_precision.policy import set_global_policy +from tf_keras.testing_infra import test_combinations class TestImageNetUtils(test_combinations.TestCase): diff --git a/keras/applications/inception_resnet_v2.py b/tf_keras/applications/inception_resnet_v2.py similarity index 96% rename from keras/applications/inception_resnet_v2.py rename to tf_keras/applications/inception_resnet_v2.py index 937139189..5c82f69e7 100644 --- a/keras/applications/inception_resnet_v2.py +++ b/tf_keras/applications/inception_resnet_v2.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== -"""Inception-ResNet V2 model for Keras. +"""Inception-ResNet V2 model for TF-Keras. Reference: - [Inception-v4, Inception-ResNet and the Impact of @@ -23,14 +23,14 @@ import tensorflow.compat.v2 as tf -import keras -from keras import backend -from keras import layers as keras_layers -from keras.applications import imagenet_utils -from keras.engine import training -from keras.layers import VersionAwareLayers -from keras.utils import data_utils -from keras.utils import layer_utils +import tf_keras as keras +from tf_keras import backend +from tf_keras import layers as keras_layers +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.layers import VersionAwareLayers +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -63,7 +63,7 @@ def InceptionResNetV2( Residual Connections on Learning](https://arxiv.org/abs/1602.07261) (AAAI 2017) - This function returns a Keras image classification model, + This function returns a TF-Keras image classification model, optionally loaded with weights pre-trained on ImageNet. For image classification use cases, see @@ -74,7 +74,7 @@ def InceptionResNetV2( [guide to transfer learning & fine-tuning]( https://keras.io/guides/transfer_learning/). - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For InceptionResNetV2, call `tf.keras.applications.inception_resnet_v2.preprocess_input` on your inputs before passing them to the model. @@ -87,7 +87,7 @@ def InceptionResNetV2( weights: one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: optional Keras tensor (i.e. output of `layers.Input()`) + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified if `include_top` is `False` (otherwise the input shape diff --git a/keras/applications/inception_v3.py b/tf_keras/applications/inception_v3.py similarity index 96% rename from keras/applications/inception_v3.py rename to tf_keras/applications/inception_v3.py index d3ab844e1..a49f51e31 100644 --- a/keras/applications/inception_v3.py +++ b/tf_keras/applications/inception_v3.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== -"""Inception V3 model for Keras. +"""Inception V3 model for TF-Keras. Reference: - [Rethinking the Inception Architecture for Computer Vision]( @@ -22,12 +22,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.applications import imagenet_utils -from keras.engine import training -from keras.layers import VersionAwareLayers -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.layers import VersionAwareLayers +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -63,7 +63,7 @@ def InceptionV3( - [Rethinking the Inception Architecture for Computer Vision]( http://arxiv.org/abs/1512.00567) (CVPR 2016) - This function returns a Keras image classification model, + This function returns a TF-Keras image classification model, optionally loaded with weights pre-trained on ImageNet. For image classification use cases, see @@ -74,7 +74,7 @@ def InceptionV3( [guide to transfer learning & fine-tuning]( https://keras.io/guides/transfer_learning/). - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For `InceptionV3`, call `tf.keras.applications.inception_v3.preprocess_input` on your inputs before passing them to the model. `inception_v3.preprocess_input` will scale input @@ -86,7 +86,7 @@ def InceptionV3( weights: One of `None` (random initialization), `imagenet` (pre-training on ImageNet), or the path to the weights file to be loaded. Defaults to `imagenet`. - input_tensor: Optional Keras tensor (i.e. output of `layers.Input()`) + input_tensor: Optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. `input_tensor` is useful for sharing inputs between multiple different networks. Defaults to `None`. input_shape: Optional shape tuple, only to be specified diff --git a/keras/applications/mobilenet.py b/tf_keras/applications/mobilenet.py similarity index 97% rename from keras/applications/mobilenet.py rename to tf_keras/applications/mobilenet.py index e3a0cdd09..9001d31b9 100644 --- a/keras/applications/mobilenet.py +++ b/tf_keras/applications/mobilenet.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== -"""MobileNet v1 models for Keras. +"""MobileNet v1 models for TF-Keras. MobileNet is a general architecture and can be used for multiple use cases. Depending on the use case, it can use different input layer size and @@ -62,12 +62,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.applications import imagenet_utils -from keras.engine import training -from keras.layers import VersionAwareLayers -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.layers import VersionAwareLayers +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -102,7 +102,7 @@ def MobileNet( for Mobile Vision Applications]( https://arxiv.org/abs/1704.04861) - This function returns a Keras image classification model, + This function returns a TF-Keras image classification model, optionally loaded with weights pre-trained on ImageNet. For image classification use cases, see @@ -113,7 +113,7 @@ def MobileNet( [guide to transfer learning & fine-tuning]( https://keras.io/guides/transfer_learning/). - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For MobileNet, call `tf.keras.applications.mobilenet.preprocess_input` on your inputs before passing them to the model. `mobilenet.preprocess_input` will scale input pixels between -1 and 1. @@ -141,7 +141,7 @@ def MobileNet( weights: One of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. Defaults to `imagenet`. - input_tensor: Optional Keras tensor (i.e. output of `layers.Input()`) to + input_tensor: Optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. `input_tensor` is useful for sharing inputs between multiple different networks. Defaults to `None`. pooling: Optional pooling mode for feature extraction when `include_top` diff --git a/keras/applications/mobilenet_v2.py b/tf_keras/applications/mobilenet_v2.py similarity index 97% rename from keras/applications/mobilenet_v2.py rename to tf_keras/applications/mobilenet_v2.py index cc09e0e17..1837fd356 100644 --- a/keras/applications/mobilenet_v2.py +++ b/tf_keras/applications/mobilenet_v2.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== -"""MobileNet v2 models for Keras. +"""MobileNet v2 models for TF-Keras. MobileNetV2 is a general architecture and can be used for multiple use cases. Depending on the use case, it can use different input layer size and @@ -76,12 +76,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.applications import imagenet_utils -from keras.engine import training -from keras.layers import VersionAwareLayers -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.layers import VersionAwareLayers +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -122,7 +122,7 @@ def MobileNetV2( - [MobileNetV2: Inverted Residuals and Linear Bottlenecks]( https://arxiv.org/abs/1801.04381) (CVPR 2018) - This function returns a Keras image classification model, + This function returns a TF-Keras image classification model, optionally loaded with weights pre-trained on ImageNet. For image classification use cases, see @@ -133,7 +133,7 @@ def MobileNetV2( [guide to transfer learning & fine-tuning]( https://keras.io/guides/transfer_learning/). - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For MobileNetV2, call `tf.keras.applications.mobilenet_v2.preprocess_input` on your inputs before passing them to the model. `mobilenet_v2.preprocess_input` will scale input pixels between -1 and 1. @@ -151,7 +151,7 @@ def MobileNetV2( E.g. `(160, 160, 3)` would be one valid value. alpha: Float, larger than zero, controls the width of the network. This is known as the width multiplier in the MobileNetV2 paper, but the name is - kept for consistency with `applications.MobileNetV1` model in Keras. + kept for consistency with `applications.MobileNetV1` model in TF-Keras. - If `alpha` < 1.0, proportionally decreases the number of filters in each layer. - If `alpha` > 1.0, proportionally increases the number @@ -163,7 +163,7 @@ def MobileNetV2( weights: String, one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: Optional Keras tensor (i.e. output of `layers.Input()`) + input_tensor: Optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. pooling: String, optional pooling mode for feature extraction when `include_top` is `False`. @@ -248,7 +248,7 @@ def MobileNetV2( ) else: raise ValueError( - "input_tensor is not a Keras tensor; " + "input_tensor is not a TF-Keras tensor; " f"Received `input_tensor={input_tensor}`" ) @@ -259,7 +259,7 @@ def MobileNetV2( backend.is_keras_tensor(input_tensor) except ValueError: raise ValueError( - "input_tensor must be a valid Keras tensor type; " + "input_tensor must be a valid TF-Keras tensor type; " f"Received {input_tensor} of type {type(input_tensor)}" ) diff --git a/keras/applications/mobilenet_v3.py b/tf_keras/applications/mobilenet_v3.py similarity index 98% rename from keras/applications/mobilenet_v3.py rename to tf_keras/applications/mobilenet_v3.py index b79c4a663..1f91730b9 100644 --- a/keras/applications/mobilenet_v3.py +++ b/tf_keras/applications/mobilenet_v3.py @@ -14,16 +14,16 @@ # ============================================================================== -"""MobileNet v3 models for Keras.""" +"""MobileNet v3 models for TF-Keras.""" import tensorflow.compat.v2 as tf -from keras import backend -from keras import models -from keras.applications import imagenet_utils -from keras.layers import VersionAwareLayers -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras import models +from tf_keras.applications import imagenet_utils +from tf_keras.layers import VersionAwareLayers +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -90,7 +90,7 @@ [guide to transfer learning & fine-tuning]( https://keras.io/guides/transfer_learning/). - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For MobileNetV3, by default input preprocessing is included as a part of the model (as a `Rescaling` layer), and thus `tf.keras.applications.mobilenet_v3.preprocess_input` is actually a @@ -114,7 +114,7 @@ E.g. `(160, 160, 3)` would be one valid value. alpha: controls the width of the network. This is known as the depth multiplier in the MobileNetV3 paper, but the name is kept for - consistency with MobileNetV1 in Keras. + consistency with MobileNetV1 in TF-Keras. - If `alpha` < 1.0, proportionally decreases the number of filters in each layer. - If `alpha` > 1.0, proportionally increases the number @@ -132,7 +132,7 @@ weights: String, one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: Optional Keras tensor (i.e. output of + input_tensor: Optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. pooling: String, optional pooling mode for feature extraction diff --git a/keras/applications/nasnet.py b/tf_keras/applications/nasnet.py similarity index 96% rename from keras/applications/nasnet.py rename to tf_keras/applications/nasnet.py index 7667d14d1..a37912c38 100644 --- a/keras/applications/nasnet.py +++ b/tf_keras/applications/nasnet.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== -"""NASNet-A models for Keras. +"""NASNet-A models for TF-Keras. NASNet refers to Neural Architecture Search Network, a family of models that were designed automatically by learning the model architectures @@ -39,12 +39,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.applications import imagenet_utils -from keras.engine import training -from keras.layers import VersionAwareLayers -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.layers import VersionAwareLayers +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -90,7 +90,7 @@ def NASNet( [guide to transfer learning & fine-tuning]( https://keras.io/guides/transfer_learning/). - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For NasNet, call `tf.keras.applications.nasnet.preprocess_input` on your inputs before passing them to the model. `nasnet.preprocess_input` will scale input pixels between -1 and 1. @@ -124,7 +124,7 @@ def NASNet( layer at the top of the network. weights: `None` (random initialization) or `imagenet` (ImageNet weights) - input_tensor: Optional Keras tensor (i.e. output of + input_tensor: Optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. pooling: Optional pooling mode for feature extraction @@ -199,7 +199,7 @@ def NASNet( "However your settings specify the default " 'data format "channels_first" (channels, width, height).' ' You should set `image_data_format="channels_last"` ' - "in your Keras config located at ~/.keras/keras.json. " + "in your TF-Keras config located at ~/.keras/keras.json. " "The model being returned right now will expect inputs " 'to follow the "channels_last" data format.' ) @@ -373,9 +373,9 @@ def NASNetMobile( Optionally loads weights pre-trained on ImageNet. Note that the data format convention used by the model is - the one specified in your Keras config at `~/.keras/keras.json`. + the one specified in your TF-Keras config at `~/.keras/keras.json`. - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For NASNet, call `tf.keras.applications.nasnet.preprocess_input` on your inputs before passing them to the model. @@ -391,7 +391,7 @@ def NASNetMobile( weights: `None` (random initialization) or `imagenet` (ImageNet weights). For loading `imagenet` weights, `input_shape` should be (224, 224, 3) - input_tensor: Optional Keras tensor (i.e. output of + input_tensor: Optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. pooling: Optional pooling mode for feature extraction @@ -416,7 +416,7 @@ def NASNetMobile( only be `None` or `"softmax"`. Returns: - A Keras model instance. + A TF-Keras model instance. Raises: ValueError: In case of invalid argument for `weights`, @@ -461,9 +461,9 @@ def NASNetLarge( Optionally loads weights pre-trained on ImageNet. Note that the data format convention used by the model is - the one specified in your Keras config at `~/.keras/keras.json`. + the one specified in your TF-Keras config at `~/.keras/keras.json`. - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For NASNet, call `tf.keras.applications.nasnet.preprocess_input` on your inputs before passing them to the model. @@ -479,7 +479,7 @@ def NASNetLarge( weights: `None` (random initialization) or `imagenet` (ImageNet weights). For loading `imagenet` weights, `input_shape` should be (331, 331, 3) - input_tensor: Optional Keras tensor (i.e. output of + input_tensor: Optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. pooling: Optional pooling mode for feature extraction @@ -504,7 +504,7 @@ def NASNetLarge( only be `None` or `"softmax"`. Returns: - A Keras model instance. + A TF-Keras model instance. Raises: ValueError: in case of invalid argument for `weights`, @@ -542,7 +542,7 @@ def _separable_conv_block( block_id: String block_id Returns: - A Keras tensor + A TF-Keras tensor """ channel_dim = 1 if backend.image_data_format() == "channels_first" else -1 @@ -601,7 +601,7 @@ def _adjust_block(p, ip, filters, block_id=None): block_id: String block_id Returns: - Adjusted Keras tensor + Adjusted TF-Keras tensor """ channel_dim = 1 if backend.image_data_format() == "channels_first" else -1 img_dim = 2 if backend.image_data_format() == "channels_first" else -2 @@ -691,7 +691,7 @@ def _normal_a_cell(ip, p, filters, block_id=None): block_id: String block_id Returns: - A Keras tensor + A TF-Keras tensor """ channel_dim = 1 if backend.image_data_format() == "channels_first" else -1 @@ -784,7 +784,7 @@ def _reduction_a_cell(ip, p, filters, block_id=None): block_id: String block_id Returns: - A Keras tensor + A TF-Keras tensor """ channel_dim = 1 if backend.image_data_format() == "channels_first" else -1 diff --git a/keras/applications/regnet.py b/tf_keras/applications/regnet.py similarity index 99% rename from keras/applications/regnet.py rename to tf_keras/applications/regnet.py index 0c8ee7de0..07224515b 100644 --- a/keras/applications/regnet.py +++ b/tf_keras/applications/regnet.py @@ -14,7 +14,7 @@ # ============================================================================== -"""RegNet models for Keras. +"""RegNet models for TF-Keras. References: @@ -26,12 +26,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras import layers -from keras.applications import imagenet_utils -from keras.engine import training -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras import layers +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -330,7 +330,7 @@ [guide to transfer learning & fine-tuning]( https://keras.io/guides/transfer_learning/). - Note: Each Keras Application expects a specific kind of input preprocessing. + Note: Each TF-Keras Application expects a specific kind of input preprocessing. For Regnets, preprocessing is included in the model using a `Rescaling` layer. RegNet models expect their inputs to be float or uint8 tensors of pixels with values in the [0-255] range. @@ -346,7 +346,7 @@ weights: One of `None` (random initialization), `"imagenet"` (pre-training on ImageNet), or the path to the weights file to be loaded. Defaults to `"imagenet"`. - input_tensor: Optional Keras tensor + input_tensor: Optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: Optional shape tuple, only to be specified @@ -889,7 +889,7 @@ def RegNet( the model. weights: one of `None` (random initialization), "imagenet" (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: optional Keras tensor (i.e. output of `layers.Input()`) to + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified if `include_top` is False. It should have exactly 3 inputs channels. diff --git a/keras/applications/resnet.py b/tf_keras/applications/resnet.py similarity index 97% rename from keras/applications/resnet.py rename to tf_keras/applications/resnet.py index adcd2b746..1ee1b395c 100644 --- a/keras/applications/resnet.py +++ b/tf_keras/applications/resnet.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== -"""ResNet models for Keras. +"""ResNet models for TF-Keras. Reference: - [Deep Residual Learning for Image Recognition]( @@ -22,12 +22,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.applications import imagenet_utils -from keras.engine import training -from keras.layers import VersionAwareLayers -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.layers import VersionAwareLayers +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -102,7 +102,7 @@ def ResNet( weights: one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: optional Keras tensor + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified @@ -642,7 +642,7 @@ def decode_predictions(preds, top=5): [guide to transfer learning & fine-tuning]( https://keras.io/guides/transfer_learning/). - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For ResNet, call `tf.keras.applications.resnet.preprocess_input` on your inputs before passing them to the model. `resnet.preprocess_input` will convert the input images from RGB to BGR, @@ -655,7 +655,7 @@ def decode_predictions(preds, top=5): weights: one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: optional Keras tensor (i.e. output of `layers.Input()`) + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified if `include_top` is False (otherwise the input shape @@ -685,7 +685,7 @@ def decode_predictions(preds, top=5): be `None` or `"softmax"`. Returns: - A Keras model instance. + A TF-Keras model instance. """ setattr(ResNet50, "__doc__", ResNet50.__doc__ + DOC) diff --git a/keras/applications/resnet_rs.py b/tf_keras/applications/resnet_rs.py similarity index 98% rename from keras/applications/resnet_rs.py rename to tf_keras/applications/resnet_rs.py index eafa79ec0..f8e34397c 100644 --- a/keras/applications/resnet_rs.py +++ b/tf_keras/applications/resnet_rs.py @@ -14,7 +14,7 @@ # ============================================================================== -"""ResNet-RS models for Keras. +"""ResNet-RS models for TF-Keras. Reference: - [Revisiting ResNets: Improved Training and Scaling Strategies]( @@ -28,12 +28,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras import layers -from keras.applications import imagenet_utils -from keras.engine import training -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras import layers +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -143,7 +143,7 @@ [guide to transfer learning & fine-tuning]( https://keras.io/guides/transfer_learning/). - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For ResNetRs, by default input preprocessing is included as a part of the model (as a `Rescaling` layer), and thus `tf.keras.applications.resnet_rs.preprocess_input` is actually a @@ -186,7 +186,7 @@ depending on input shape it was trained with. For input_shape 224x224 pass `imagenet-i224` as argument. By default, highest input shape weights are downloaded. - input_tensor: optional Keras tensor (i.e. output of `layers.Input()`) to + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. classes: optional number of classes to classify images into, only to be specified if `include_top` is True, and if no `weights` argument is @@ -573,7 +573,7 @@ def ResNetRS( on input shape it was trained with. For input_shape 224x224 pass `imagenet-i224` as argument. By default, highest input shape weights are downloaded. - input_tensor: optional Keras tensor (i.e. output of `layers.Input()`) to + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. classes: optional number of classes to classify images into, only to be specified if `include_top` is True, and if no `weights` argument is diff --git a/keras/applications/resnet_v2.py b/tf_keras/applications/resnet_v2.py similarity index 95% rename from keras/applications/resnet_v2.py rename to tf_keras/applications/resnet_v2.py index 98117d6ac..ed64436cf 100644 --- a/keras/applications/resnet_v2.py +++ b/tf_keras/applications/resnet_v2.py @@ -13,15 +13,15 @@ # limitations under the License. # ============================================================================== -"""ResNet v2 models for Keras. +"""ResNet v2 models for TF-Keras. Reference: - [Identity Mappings in Deep Residual Networks]( https://arxiv.org/abs/1603.05027) (CVPR 2016) """ -from keras.applications import imagenet_utils -from keras.applications import resnet +from tf_keras.applications import imagenet_utils +from tf_keras.applications import resnet # isort: off from tensorflow.python.util.tf_export import keras_export @@ -165,7 +165,7 @@ def decode_predictions(preds, top=5): [guide to transfer learning & fine-tuning]( https://keras.io/guides/transfer_learning/). - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For ResNetV2, call `tf.keras.applications.resnet_v2.preprocess_input` on your inputs before passing them to the model. `resnet_v2.preprocess_input` will scale input pixels between -1 and 1. @@ -176,7 +176,7 @@ def decode_predictions(preds, top=5): weights: one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: optional Keras tensor (i.e. output of `layers.Input()`) + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified if `include_top` is False (otherwise the input shape diff --git a/keras/applications/vgg16.py b/tf_keras/applications/vgg16.py similarity index 96% rename from keras/applications/vgg16.py rename to tf_keras/applications/vgg16.py index f7eebee3d..c80f6e6f4 100644 --- a/keras/applications/vgg16.py +++ b/tf_keras/applications/vgg16.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== -"""VGG16 model for Keras. +"""VGG16 model for TF-Keras. Reference: - [Very Deep Convolutional Networks for Large-Scale Image Recognition] @@ -22,12 +22,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.applications import imagenet_utils -from keras.engine import training -from keras.layers import VersionAwareLayers -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.layers import VersionAwareLayers +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -71,7 +71,7 @@ def VGG16( The default input size for this model is 224x224. - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For VGG16, call `tf.keras.applications.vgg16.preprocess_input` on your inputs before passing them to the model. `vgg16.preprocess_input` will convert the input images from RGB to BGR, @@ -84,7 +84,7 @@ def VGG16( weights: one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: optional Keras tensor + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified diff --git a/keras/applications/vgg19.py b/tf_keras/applications/vgg19.py similarity index 96% rename from keras/applications/vgg19.py rename to tf_keras/applications/vgg19.py index b763dff5f..06cf063c4 100644 --- a/keras/applications/vgg19.py +++ b/tf_keras/applications/vgg19.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== -"""VGG19 model for Keras. +"""VGG19 model for TF-Keras. Reference: - [Very Deep Convolutional Networks for Large-Scale Image Recognition]( @@ -22,12 +22,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.applications import imagenet_utils -from keras.engine import training -from keras.layers import VersionAwareLayers -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.layers import VersionAwareLayers +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -71,7 +71,7 @@ def VGG19( The default input size for this model is 224x224. - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For VGG19, call `tf.keras.applications.vgg19.preprocess_input` on your inputs before passing them to the model. `vgg19.preprocess_input` will convert the input images from RGB to BGR, @@ -84,7 +84,7 @@ def VGG19( weights: one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: optional Keras tensor + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified diff --git a/keras/applications/xception.py b/tf_keras/applications/xception.py similarity index 97% rename from keras/applications/xception.py rename to tf_keras/applications/xception.py index e7e4ff597..95a2954dc 100644 --- a/keras/applications/xception.py +++ b/tf_keras/applications/xception.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== -"""Xception V1 model for Keras. +"""Xception V1 model for TF-Keras. On ImageNet, this model gets to a top-1 validation accuracy of 0.790 and a top-5 validation accuracy of 0.945. @@ -25,12 +25,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.applications import imagenet_utils -from keras.engine import training -from keras.layers import VersionAwareLayers -from keras.utils import data_utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras.applications import imagenet_utils +from tf_keras.engine import training +from tf_keras.layers import VersionAwareLayers +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -75,7 +75,7 @@ def Xception( The default input image size for this model is 299x299. - Note: each Keras Application expects a specific kind of input preprocessing. + Note: each TF-Keras Application expects a specific kind of input preprocessing. For Xception, call `tf.keras.applications.xception.preprocess_input` on your inputs before passing them to the model. `xception.preprocess_input` will scale input pixels between -1 and 1. @@ -86,7 +86,7 @@ def Xception( weights: one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. - input_tensor: optional Keras tensor + input_tensor: optional TF-Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified diff --git a/keras/backend.py b/tf_keras/backend.py similarity index 98% rename from keras/backend.py rename to tf_keras/backend.py index 7f5b6b1d4..4ac0deee4 100644 --- a/keras/backend.py +++ b/tf_keras/backend.py @@ -29,15 +29,15 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend_config -from keras.distribute import distribute_coordinator_utils as dc -from keras.dtensor import dtensor_api as dtensor -from keras.engine import keras_tensor -from keras.utils import control_flow_util -from keras.utils import object_identity -from keras.utils import tf_contextlib -from keras.utils import tf_inspect -from keras.utils import tf_utils +from tf_keras import backend_config +from tf_keras.distribute import distribute_coordinator_utils as dc +from tf_keras.dtensor import dtensor_api as dtensor +from tf_keras.engine import keras_tensor +from tf_keras.utils import control_flow_util +from tf_keras.utils import object_identity +from tf_keras.utils import tf_contextlib +from tf_keras.utils import tf_inspect +from tf_keras.utils import tf_utils # isort: off from tensorflow.core.protobuf import config_pb2 @@ -53,7 +53,7 @@ # INTERNAL UTILS -# The internal graph maintained by Keras and used by the symbolic Keras APIs +# The internal graph maintained by TF-Keras and used by the symbolic TF-Keras APIs # while executing eagerly (such as the functional API for model-building). # This is thread-local to allow building separate models in different threads # concurrently, but comes at the cost of not being able to build one model @@ -65,7 +65,7 @@ # This is a thread local object that will hold the default internal TF session -# used by Keras. It can be set manually via `set_session(sess)`. +# used by TF-Keras. It can be set manually via `set_session(sess)`. class SessionLocal(threading.local): def __init__(self): super().__init__() @@ -149,7 +149,7 @@ def __init__(self): def backend(): """Publicly accessible method for determining the current backend. - Only exists for API compatibility with multi-backend Keras. + Only exists for API compatibility with multi-backend TF-Keras. Returns: The string "tensorflow". @@ -161,7 +161,7 @@ def backend(): @tf.__internal__.dispatch.add_dispatch_support @doc_controls.do_not_generate_docs def cast_to_floatx(x): - """Cast a Numpy array to the default Keras float type. + """Cast a Numpy array to the default TF-Keras float type. Args: x: Numpy array or TensorFlow tensor. @@ -225,9 +225,9 @@ def reset_uids(): @keras_export("keras.backend.clear_session") def clear_session(): - """Resets all state generated by Keras. + """Resets all state generated by TF-Keras. - Keras manages a global state, which it uses to implement the Functional + TF-Keras manages a global state, which it uses to implement the Functional model-building API and to uniquify autogenerated layer names. If you are creating many models in a loop, this global state will consume @@ -246,7 +246,7 @@ def clear_session(): for _ in range(100): # With `clear_session()` called at the beginning, - # Keras starts with a blank state at each iteration + # TF-Keras starts with a blank state at each iteration # and memory consumption is constant over time. tf.keras.backend.clear_session() model = tf.keras.Sequential([ @@ -298,7 +298,7 @@ def clear_session(): # Inject the clear_session function to keras_deps to remove the dependency -# from TFLite to Keras. +# from TFLite to TF-Keras. tf.__internal__.register_clear_session_function(clear_session) @@ -326,7 +326,7 @@ def learning_phase(): """Returns the learning phase flag. The learning phase flag is a bool tensor (0 = test, 1 = train) - to be passed as input to any Keras function + to be passed as input to any TF-Keras function that uses a different behavior at train time and test time. Returns: @@ -335,7 +335,7 @@ def learning_phase(): graph = tf.compat.v1.get_default_graph() if graph is getattr(_GRAPH, "graph", None): # Don't enter an init_scope for the learning phase if eager execution - # is enabled but we're inside the Keras workspace graph. + # is enabled but we're inside the TF-Keras workspace graph. learning_phase = symbolic_learning_phase() else: with tf.init_scope(): @@ -430,7 +430,7 @@ def set_learning_phase(value): The backend learning phase affects any code that calls `backend.learning_phase()` - In particular, all Keras built-in layers use the learning phase as the + In particular, all TF-Keras built-in layers use the learning phase as the default for the `training` arg to `Layer.__call__`. User-written layers and models can achieve the same behavior with code that @@ -486,7 +486,7 @@ def deprecated_internal_set_learning_phase(value): with tf.init_scope(): if tf.executing_eagerly(): # In an eager context, the learning phase values applies to both the - # eager context and the internal Keras graph. + # eager context and the internal TF-Keras graph. _DUMMY_EAGER_GRAPH.learning_phase_is_set = True _internal_set_learning_phase(_DUMMY_EAGER_GRAPH.key, value) @@ -763,10 +763,10 @@ def get_session(op_input_list=()): If a default TensorFlow session is available, we will return it. - Else, we will return the global Keras session assuming it matches + Else, we will return the global TF-Keras session assuming it matches the current graph. - If no global Keras session exists at this point: + If no global TF-Keras session exists at this point: we will create a new global session. Note that you can manually set the global session @@ -788,11 +788,11 @@ def get_session(op_input_list=()): # Inject the get_session function to keras_deps to remove the dependency -# from TFLite to Keras. +# from TFLite to TF-Keras. tf.__internal__.register_get_session_function(get_session) # Inject the get_session function to tracking_util to avoid the backward -# dependency from TF to Keras. +# dependency from TF to TF-Keras. tf.__internal__.tracking.register_session_provider(get_session) @@ -859,7 +859,7 @@ def set_session(session): def get_default_session_config(): if os.environ.get("OMP_NUM_THREADS"): logging.warning( - "OMP_NUM_THREADS is no longer used by the default Keras config. " + "OMP_NUM_THREADS is no longer used by the default TF-Keras config. " "To configure the number of threads, use tf.config.threading APIs." ) @@ -1103,7 +1103,7 @@ def variable(value, dtype=None, name=None, constraint=None): applied to the variable after an optimizer update. Returns: - A variable instance (with Keras metadata included). + A variable instance (with TF-Keras metadata included). Examples: @@ -1177,7 +1177,7 @@ def unique_object_name( zero_based=False, avoid_observed_names=False, ): - """Makes a object name (or any string) unique within a Keras session. + """Makes a object name (or any string) unique within a TF-Keras session. Args: name: String name to make unique. @@ -1288,16 +1288,16 @@ def constant(value, dtype=None, shape=None, name=None): @keras_export("keras.backend.is_keras_tensor") def is_keras_tensor(x): - """Returns whether `x` is a Keras tensor. + """Returns whether `x` is a TF-Keras tensor. - A "Keras tensor" is a tensor that was returned by a Keras layer, + A "Keras tensor" is a tensor that was returned by a TF-Keras layer, (`Layer` class) or by `Input`. Args: x: A candidate tensor. Returns: - A boolean: Whether the argument is a Keras tensor. + A boolean: Whether the argument is a TF-Keras tensor. Raises: ValueError: In case `x` is not a symbolic tensor. @@ -1313,19 +1313,19 @@ def is_keras_tensor(x): ``. Expected a symbolic tensor instance. >>> keras_var = tf.keras.backend.variable(np_var) - >>> # A variable created with the keras backend is not a Keras tensor. + >>> # A variable created with the keras backend is not a TF-Keras tensor. >>> tf.keras.backend.is_keras_tensor(keras_var) False >>> keras_placeholder = tf.keras.backend.placeholder(shape=(2, 4, 5)) - >>> # A placeholder is a Keras tensor. + >>> # A placeholder is a TF-Keras tensor. >>> tf.keras.backend.is_keras_tensor(keras_placeholder) True >>> keras_input = tf.keras.layers.Input([10]) - >>> # An Input is a Keras tensor. + >>> # An Input is a TF-Keras tensor. >>> tf.keras.backend.is_keras_tensor(keras_input) True >>> keras_layer_output = tf.keras.layers.Dense(10)(keras_input) - >>> # Any Keras layer output is a Keras tensor. + >>> # Any TF-Keras layer output is a TF-Keras tensor. >>> tf.keras.backend.is_keras_tensor(keras_layer_output) True @@ -1375,7 +1375,7 @@ def placeholder( ValueError: If called with sparse = True and ragged = True. Returns: - Tensor instance (with Keras metadata included). + Tensor instance (with TF-Keras metadata included). Examples: @@ -1445,7 +1445,7 @@ def tensor_spec_to_placeholder(tensorspec): # Add keras_history connectivity information to the placeholder # when the placeholder is built in a top-level eager context # (intended to be used with keras.backend.function) - from keras.engine import ( + from tf_keras.engine import ( input_layer, ) @@ -1567,7 +1567,7 @@ def ndim(x): @tf.__internal__.dispatch.add_dispatch_support @doc_controls.do_not_generate_docs def dtype(x): - """Returns the dtype of a Keras tensor or variable, as a string. + """Returns the dtype of a TF-Keras tensor or variable, as a string. Args: x: Tensor or variable. @@ -1599,7 +1599,7 @@ def dtype(x): @doc_controls.do_not_generate_docs def dtype_numpy(x): - """Returns the numpy dtype of a Keras tensor or variable. + """Returns the numpy dtype of a TF-Keras tensor or variable. Args: x: Tensor or variable. @@ -1639,12 +1639,12 @@ def zeros(shape, dtype=None, name=None): """Instantiates an all-zeros variable and returns it. Args: - shape: Tuple or list of integers, shape of returned Keras variable - dtype: data type of returned Keras variable - name: name of returned Keras variable + shape: Tuple or list of integers, shape of returned TF-Keras variable + dtype: data type of returned TF-Keras variable + name: name of returned TF-Keras variable Returns: - A variable (including Keras metadata), filled with `0.0`. + A variable (including TF-Keras metadata), filled with `0.0`. Note that if `shape` was symbolic, we cannot return a variable, and will return a dynamically-shaped tensor instead. @@ -1685,12 +1685,12 @@ def ones(shape, dtype=None, name=None): """Instantiates an all-ones variable and returns it. Args: - shape: Tuple of integers, shape of returned Keras variable. - dtype: String, data type of returned Keras variable. - name: String, name of returned Keras variable. + shape: Tuple of integers, shape of returned TF-Keras variable. + dtype: String, data type of returned TF-Keras variable. + name: String, name of returned TF-Keras variable. Returns: - A Keras variable, filled with `1.0`. + A TF-Keras variable, filled with `1.0`. Note that if `shape` was symbolic, we cannot return a variable, and will return a dynamically-shaped tensor instead. @@ -1722,11 +1722,11 @@ def eye(size, dtype=None, name=None): Args: size: Integer, number of rows/columns. - dtype: String, data type of returned Keras variable. - name: String, name of returned Keras variable. + dtype: String, data type of returned TF-Keras variable. + name: String, name of returned TF-Keras variable. Returns: - A Keras variable, an identity matrix. + A TF-Keras variable, an identity matrix. Example: @@ -1751,13 +1751,13 @@ def zeros_like(x, dtype=None, name=None): """Instantiates an all-zeros variable of the same shape as another tensor. Args: - x: Keras variable or Keras tensor. - dtype: dtype of returned Keras variable. + x: TF-Keras variable or TF-Keras tensor. + dtype: dtype of returned TF-Keras variable. `None` uses the dtype of `x`. name: name for the variable to create. Returns: - A Keras variable with the shape of `x` filled with zeros. + A TF-Keras variable with the shape of `x` filled with zeros. Example: @@ -1778,13 +1778,13 @@ def ones_like(x, dtype=None, name=None): """Instantiates an all-ones variable of the same shape as another tensor. Args: - x: Keras variable or tensor. - dtype: String, dtype of returned Keras variable. + x: TF-Keras variable or tensor. + dtype: String, dtype of returned TF-Keras variable. None uses the dtype of x. name: String, name for the variable to create. Returns: - A Keras variable with the shape of x filled with ones. + A TF-Keras variable with the shape of x filled with ones. Example: @@ -1832,7 +1832,7 @@ def identity(x, name=None): "keras.backend.experimental.is_tf_random_generator_enabled", v1=[] ) def is_tf_random_generator_enabled(): - """Check whether `tf.random.Generator` is used for RNG in Keras. + """Check whether `tf.random.Generator` is used for RNG in TF-Keras. Compared to existing TF stateful random ops, `tf.random.Generator` uses `tf.Variable` and stateless random ops to generate random numbers, @@ -1855,14 +1855,14 @@ def is_tf_random_generator_enabled(): Returns: boolean: whether `tf.random.Generator` is used for random number - generation in Keras. + generation in TF-Keras. """ return _USE_GENERATOR_FOR_RNG @keras_export("keras.backend.experimental.enable_tf_random_generator", v1=[]) def enable_tf_random_generator(): - """Enable the `tf.random.Generator` as the RNG for Keras. + """Enable the `tf.random.Generator` as the RNG for TF-Keras. See `tf.keras.backend.experimental.is_tf_random_generator_enabled` for more details. @@ -1874,7 +1874,7 @@ def enable_tf_random_generator(): @keras_export("keras.backend.experimental.disable_tf_random_generator", v1=[]) def disable_tf_random_generator(): - """Disable the `tf.random.Generator` as the RNG for Keras. + """Disable the `tf.random.Generator` as the RNG for TF-Keras. See `tf.keras.backend.experimental.is_tf_random_generator_enabled` for more details. @@ -2181,15 +2181,15 @@ def random_uniform_variable(shape, low, high, dtype=None, name=None, seed=None): """Instantiates a variable with values drawn from a uniform distribution. Args: - shape: Tuple of integers, shape of returned Keras variable. + shape: Tuple of integers, shape of returned TF-Keras variable. low: Float, lower boundary of the output interval. high: Float, upper boundary of the output interval. - dtype: String, dtype of returned Keras variable. - name: String, name of returned Keras variable. + dtype: String, dtype of returned TF-Keras variable. + name: String, name of returned TF-Keras variable. seed: Integer, random seed. Returns: - A Keras variable, filled with drawn samples. + A TF-Keras variable, filled with drawn samples. Example: @@ -2219,15 +2219,15 @@ def random_normal_variable( """Instantiates a variable with values drawn from a normal distribution. Args: - shape: Tuple of integers, shape of returned Keras variable. + shape: Tuple of integers, shape of returned TF-Keras variable. mean: Float, mean of the normal distribution. scale: Float, standard deviation of the normal distribution. - dtype: String, dtype of returned Keras variable. - name: String, name of returned Keras variable. + dtype: String, dtype of returned TF-Keras variable. + name: String, name of returned TF-Keras variable. seed: Integer, random seed. Returns: - A Keras variable, filled with drawn samples. + A TF-Keras variable, filled with drawn samples. Example: @@ -2279,14 +2279,14 @@ def count_params(x): def cast(x, dtype): """Casts a tensor to a different dtype and returns it. - You can cast a Keras variable but it still returns a Keras tensor. + You can cast a TF-Keras variable but it still returns a TF-Keras tensor. Args: - x: Keras tensor (or variable). + x: TF-Keras tensor (or variable). dtype: String, either (`'float16'`, `'float32'`, or `'float64'`). Returns: - Keras tensor with dtype `dtype`. + TF-Keras tensor with dtype `dtype`. Examples: Cast a float32 variable to a float64 tensor @@ -2478,8 +2478,8 @@ def batch_dot(x, y, axes=None): we use `expand_dims` to make sure that ndim is at least 2. Args: - x: Keras tensor or variable with `ndim >= 2`. - y: Keras tensor or variable with `ndim >= 2`. + x: TF-Keras tensor or variable with `ndim >= 2`. + y: TF-Keras tensor or variable with `ndim >= 2`. axes: Tuple or list of integers with target dimensions, or single integer. The sizes of `x.shape[axes[0]]` and `y.shape[axes[1]]` should be equal. @@ -4221,7 +4221,7 @@ def get_value(x): return x.numpy() if tf.compat.v1.executing_eagerly_outside_functions(): - # This method of evaluating works inside the Keras FuncGraph. + # This method of evaluating works inside the TF-Keras FuncGraph. with tf.init_scope(): return x.numpy() @@ -4412,7 +4412,7 @@ class GraphExecutionFunction: substitutions are merged with substitutions from `inputs`. Even though `feed_dict` is passed once in the constructor (called in `model.compile()`) we can modify the values in the dictionary. Through this feed_dict we can - provide additional substitutions besides Keras inputs. + provide additional substitutions besides TF-Keras inputs. Args: inputs: Feed placeholders to the computation graph. @@ -4429,7 +4429,7 @@ def __init__( updates = updates or [] if not isinstance(updates, (list, tuple)): raise TypeError( - "`updates` in a Keras backend function " + "`updates` in a TF-Keras backend function " "should be a list or tuple." ) @@ -4623,7 +4623,7 @@ def __call__(self, inputs): @keras_export("keras.backend.function") @doc_controls.do_not_generate_docs def function(inputs, outputs, updates=None, name=None, **kwargs): - """Instantiates a Keras function. + """Instantiates a TF-Keras function. Args: inputs: List of placeholder tensors. @@ -4649,7 +4649,7 @@ def function(inputs, outputs, updates=None, name=None, **kwargs): "`updates` argument is not supported during " "eager execution. You passed: %s" % (updates,) ) - from keras import models + from tf_keras import models model = models.Model(inputs=inputs, outputs=outputs) @@ -5293,7 +5293,7 @@ def in_train_phase(x, alt, training=None): Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`. """ - from keras.engine import ( + from tf_keras.engine import ( base_layer_utils, ) @@ -7079,7 +7079,7 @@ def truncated_normal(shape, mean=0.0, stddev=1.0, dtype=None, seed=None): # CTC # TensorFlow has a native implementation, but it uses sparse tensors -# and therefore requires a wrapper for Keras. The functions below convert +# and therefore requires a wrapper for TF-Keras. The functions below convert # dense to sparse tensors and also wraps up the beam search code that is # in TensorFlow's CTC implementation @@ -7286,8 +7286,8 @@ def foldr(fn, elems, initializer=None, name=None): return tf.compat.v1.foldr(fn, elems, initializer=initializer, name=name) -# Load Keras default configuration from config file if present. -# Set Keras base dir path given KERAS_HOME env variable, if applicable. +# Load TF-Keras default configuration from config file if present. +# Set TF-Keras base dir path given KERAS_HOME env variable, if applicable. # Otherwise either ~/.keras or /tmp. if "KERAS_HOME" in os.environ: _keras_dir = os.environ.get("KERAS_HOME") @@ -7557,7 +7557,7 @@ def setdefault(self, key=None, default=None, kwargs=None): # This dictionary holds a mapping {graph: learning_phase}. In eager mode, a # dummy object is used. -# A learning phase is a bool tensor used to run Keras models in +# A learning phase is a bool tensor used to run TF-Keras models in # either train mode (learning_phase == 1) or test mode (learning_phase == 0). _GRAPH_LEARNING_PHASES = ContextValueCache( object_identity.ObjectIdentityWeakSet diff --git a/keras/backend_config.py b/tf_keras/backend_config.py similarity index 98% rename from keras/backend_config.py rename to tf_keras/backend_config.py index 948cec331..818cd8b7d 100644 --- a/keras/backend_config.py +++ b/tf_keras/backend_config.py @@ -88,7 +88,7 @@ def set_floatx(value): is using a mix of float16 and float32, can be used by calling `tf.keras.mixed_precision.set_global_policy('mixed_float16')`. See the [mixed precision guide]( - https://www.tensorflow.org/guide/keras/mixed_precision) for details. + https://www.tensorflow.org/guide/tf_keras/mixed_precision) for details. Args: value: String; `'float16'`, `'float32'`, or `'float64'`. diff --git a/keras/backend_config_test.py b/tf_keras/backend_config_test.py similarity index 94% rename from keras/backend_config_test.py rename to tf_keras/backend_config_test.py index 5e8e9e2c0..27315c8c9 100644 --- a/keras/backend_config_test.py +++ b/tf_keras/backend_config_test.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras import backend_config -from keras.testing_infra import test_combinations +from tf_keras import backend +from tf_keras import backend_config +from tf_keras.testing_infra import test_combinations @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/backend_test.py b/tf_keras/backend_test.py similarity index 99% rename from keras/backend_test.py rename to tf_keras/backend_test.py index b47ca213d..3016bd5be 100644 --- a/keras/backend_test.py +++ b/tf_keras/backend_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras backend.""" +"""Tests for TF-Keras backend.""" import gc import warnings @@ -22,15 +22,15 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import activations -from keras import backend -from keras.engine import input_layer -from keras.layers import activation -from keras.layers.normalization import batch_normalization_v1 -from keras.testing_infra import test_combinations -from keras.utils import losses_utils -from keras.utils import tf_inspect -from keras.utils import tf_utils +from tf_keras import activations +from tf_keras import backend +from tf_keras.engine import input_layer +from tf_keras.layers import activation +from tf_keras.layers.normalization import batch_normalization_v1 +from tf_keras.testing_infra import test_combinations +from tf_keras.utils import losses_utils +from tf_keras.utils import tf_inspect +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.eager import context @@ -2768,7 +2768,7 @@ def test_function_placeholder_with_default(self): self.assertEqual(output_values, [5.0, 6.0]) def test_function_tf_feed_symbols(self): - # Test Keras backend functions with TF tensor inputs. + # Test TF-Keras backend functions with TF tensor inputs. with tf.Graph().as_default(), self.cached_session(): # Test feeding a resource variable to `function`. x1 = backend.placeholder(shape=()) @@ -2830,7 +2830,7 @@ def test_function_tf_feed_dict(self): # `tf.compat.v1.Session().run()` via its `feed_dict` arguments. Note # that the feed_dict is passed once in the constructor but we can modify # the values in the dictionary. Through this feed_dict we can provide - # additional substitutions besides Keras inputs. + # additional substitutions besides TF-Keras inputs. with tf.Graph().as_default(), self.cached_session(): x = backend.variable(0.0) y = backend.variable(0.0) diff --git a/keras/benchmarks/BUILD b/tf_keras/benchmarks/BUILD similarity index 84% rename from keras/benchmarks/BUILD rename to tf_keras/benchmarks/BUILD index eacb26a3a..9aeb5a78b 100644 --- a/keras/benchmarks/BUILD +++ b/tf_keras/benchmarks/BUILD @@ -1,13 +1,13 @@ # Description: -# Implementation of Keras benchmarks. +# Implementation of TF-Keras benchmarks. # Placeholder: load unaliased py_library # Placeholder: load unaliased py_test # Placeholder: load unaliased py_binary -load("@org_keras//keras:keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = ["//visibility:public"], licenses = ["notice"], ) @@ -32,7 +32,7 @@ py_library( deps = [ ":benchmark_util", ":distribution_util", - "//keras/benchmarks/saved_model_benchmarks:saved_model_benchmark_util", + "//tf_keras/benchmarks/saved_model_benchmarks:saved_model_benchmark_util", ], ) @@ -41,8 +41,8 @@ py_library( name = "profiler_lib", srcs_version = "PY3", visibility = [ - "//keras:friends", "//learning/brain/contrib/keras_benchmark:__subpackages__", + "//tf_keras:friends", ], ) @@ -62,7 +62,7 @@ py_test( ":profiler_lib", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -77,8 +77,8 @@ cuda_py_test( deps = [ ":profiler_lib", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/utils:tf_inspect", + "//tf_keras/api:keras_api", + "//tf_keras/utils:tf_inspect", ], ) @@ -89,7 +89,7 @@ cuda_py_test( deps = [ ":profiler_lib", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -101,7 +101,7 @@ py_library( ":distribution_util", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -113,7 +113,7 @@ py_test( deps = [ ":benchmark_util", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -137,12 +137,12 @@ py_test( ":benchmark_util", ":profiler_lib", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/optimizers/legacy:optimizers", + "//tf_keras/api:keras_api", + "//tf_keras/optimizers/legacy:optimizers", ], ) -# Run memory profiler on Keras model. +# Run memory profiler on TF-Keras model. # Please make sure `memory_profiler` is installed. # To run the memory profiler: # With CPU: @@ -165,6 +165,6 @@ py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) diff --git a/tf_keras/benchmarks/README.md b/tf_keras/benchmarks/README.md new file mode 100644 index 000000000..f190b7df3 --- /dev/null +++ b/tf_keras/benchmarks/README.md @@ -0,0 +1,3 @@ +# TF-Keras Benchmark + +This package contains benchmarks on TF-Keras models and components. diff --git a/keras/benchmarks/__init__.py b/tf_keras/benchmarks/__init__.py similarity index 100% rename from keras/benchmarks/__init__.py rename to tf_keras/benchmarks/__init__.py diff --git a/keras/benchmarks/benchmark_util.py b/tf_keras/benchmarks/benchmark_util.py similarity index 98% rename from keras/benchmarks/benchmark_util.py rename to tf_keras/benchmarks/benchmark_util.py index a37b71ac0..d59800b70 100644 --- a/keras/benchmarks/benchmark_util.py +++ b/tf_keras/benchmarks/benchmark_util.py @@ -18,8 +18,8 @@ import numpy as np -from keras import callbacks -from keras.benchmarks import distribution_util +from tf_keras import callbacks +from tf_keras.benchmarks import distribution_util def get_benchmark_name(name): diff --git a/keras/benchmarks/benchmark_util_test.py b/tf_keras/benchmarks/benchmark_util_test.py similarity index 97% rename from keras/benchmarks/benchmark_util_test.py rename to tf_keras/benchmarks/benchmark_util_test.py index a667f53c5..ea0fbec48 100644 --- a/keras/benchmarks/benchmark_util_test.py +++ b/tf_keras/benchmarks/benchmark_util_test.py @@ -16,7 +16,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks import benchmark_util +from tf_keras.benchmarks import benchmark_util class BenchmarkUtilTest(tf.test.TestCase): diff --git a/keras/benchmarks/distribution_util.py b/tf_keras/benchmarks/distribution_util.py similarity index 100% rename from keras/benchmarks/distribution_util.py rename to tf_keras/benchmarks/distribution_util.py diff --git a/keras/benchmarks/eager_microbenchmarks_test.py b/tf_keras/benchmarks/eager_microbenchmarks_test.py similarity index 98% rename from keras/benchmarks/eager_microbenchmarks_test.py rename to tf_keras/benchmarks/eager_microbenchmarks_test.py index 19b42f750..0bce3f8d0 100644 --- a/keras/benchmarks/eager_microbenchmarks_test.py +++ b/tf_keras/benchmarks/eager_microbenchmarks_test.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Microbenchmarks for Keras components in eager mode.""" +"""Microbenchmarks for TF-Keras components in eager mode.""" import time import tensorflow.compat.v2 as tf -from keras.utils import tf_inspect +from tf_keras.utils import tf_inspect # isort: off from tensorflow.python.eager import context diff --git a/keras/benchmarks/keras_cpu_benchmark_test.py b/tf_keras/benchmarks/keras_cpu_benchmark_test.py similarity index 97% rename from keras/benchmarks/keras_cpu_benchmark_test.py rename to tf_keras/benchmarks/keras_cpu_benchmark_test.py index 6ca5cb8c3..01a1e8e82 100644 --- a/keras/benchmarks/keras_cpu_benchmark_test.py +++ b/tf_keras/benchmarks/keras_cpu_benchmark_test.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Benchmark tests for CPU performance of Keras models.""" +"""Benchmark tests for CPU performance of TF-Keras models.""" import numpy as np import tensorflow.compat.v2 as tf -from keras.benchmarks import benchmark_util +from tf_keras.benchmarks import benchmark_util # Loss function and optimizer. _LOSS = "binary_crossentropy" diff --git a/keras/benchmarks/keras_examples_benchmarks/BUILD b/tf_keras/benchmarks/keras_examples_benchmarks/BUILD similarity index 67% rename from keras/benchmarks/keras_examples_benchmarks/BUILD rename to tf_keras/benchmarks/keras_examples_benchmarks/BUILD index 932a7643a..097561bc3 100644 --- a/keras/benchmarks/keras_examples_benchmarks/BUILD +++ b/tf_keras/benchmarks/keras_examples_benchmarks/BUILD @@ -1,10 +1,10 @@ # Description: -# Implementation of Keras benchmarks. +# Implementation of TF-Keras benchmarks. -load("@org_keras//keras:keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = ["//visibility:public"], licenses = ["notice"], ) @@ -34,9 +34,9 @@ cuda_py_test( tags = COMMON_TAGS, deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:benchmark_util", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:benchmark_util", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -47,9 +47,9 @@ cuda_py_test( tags = COMMON_TAGS, deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:benchmark_util", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:benchmark_util", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -60,9 +60,9 @@ cuda_py_test( tags = COMMON_TAGS, deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:benchmark_util", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:benchmark_util", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -74,9 +74,9 @@ cuda_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:benchmark_util", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:benchmark_util", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -87,9 +87,9 @@ cuda_py_test( tags = COMMON_TAGS, deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:benchmark_util", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:benchmark_util", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -100,9 +100,9 @@ cuda_py_test( tags = COMMON_TAGS, deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:benchmark_util", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:benchmark_util", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -114,9 +114,9 @@ cuda_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:benchmark_util", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:benchmark_util", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -127,9 +127,9 @@ cuda_py_test( tags = COMMON_TAGS, deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:benchmark_util", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:benchmark_util", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -140,9 +140,9 @@ cuda_py_test( tags = COMMON_TAGS, deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:benchmark_util", - "//keras/benchmarks:distribution_util", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:benchmark_util", + "//tf_keras/benchmarks:distribution_util", + "//tf_keras/benchmarks:profiler_lib", ], ) diff --git a/keras/benchmarks/keras_examples_benchmarks/README.md b/tf_keras/benchmarks/keras_examples_benchmarks/README.md similarity index 88% rename from keras/benchmarks/keras_examples_benchmarks/README.md rename to tf_keras/benchmarks/keras_examples_benchmarks/README.md index 42bae76a5..582cc486f 100644 --- a/keras/benchmarks/keras_examples_benchmarks/README.md +++ b/tf_keras/benchmarks/keras_examples_benchmarks/README.md @@ -20,12 +20,12 @@ - [Add new benchmarks](#add-new-benchmarks) - [Troubleshooting](#troubleshooting) -## Keras benchmarks +## TF-Keras benchmarks These are benchmark tests running on keras models: models from -[keras/examples](https://github.com/keras-team/keras/tree/master/examples). +[keras/examples](https://github.com/keras-team/tf-keras/tree/master/examples). Benchmarks in the current folder -(`https://github.com/keras-team/keras/blob/master/keras/benchmarks/keras_examples_benchmarks`) use Keras +(`https://github.com/keras-team/tf-keras/blob/master/tf_keras/benchmarks/keras_examples_benchmarks`) use Keras [built-in dataset](https://keras.io/api/datasets/). In addition, these benchmarks support different [distribution strategies](https://www.tensorflow.org/guide/distributed_training) @@ -37,27 +37,27 @@ These examples are implemented by Functional API and Sequential API. #### Computer Vision examples -- [cifar10_cnn_benchmark_test.py](https://github.com/keras-team/keras/blob/master/keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py): +- [cifar10_cnn_benchmark_test.py](https://github.com/keras-team/tf-keras/blob/master/tf_keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py): Simple CNN on CIFAR10 image dataset. -- [mnist_conv_benchmark_test.py](https://github.com/keras-team/keras/blob/master/keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py): +- [mnist_conv_benchmark_test.py](https://github.com/keras-team/tf-keras/blob/master/tf_keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py): Simple Convnet that achieves ~99% test accuracy on MNIST. -- [mnist_hierarchical_rnn_benchmark_test.py](https://github.com/keras-team/keras/blob/master/keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py): +- [mnist_hierarchical_rnn_benchmark_test.py](https://github.com/keras-team/tf-keras/blob/master/tf_keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py): Hierarchical RNN (HRNN) to classify MNIST digits. #### Text & Sequence examples -- [Bidirectional_lstm_benchmark_test.py](https://github.com/keras-team/keras/blob/master/keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py): +- [Bidirectional_lstm_benchmark_test.py](https://github.com/keras-team/tf-keras/blob/master/tf_keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py): 2-layer bidirectional LSTM on IMDB movie review dataset. -- [text_classification_transformer_benchmark_test.py](https://github.com/keras-team/keras/blob/master/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py): +- [text_classification_transformer_benchmark_test.py](https://github.com/keras-team/tf-keras/blob/master/tf_keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py): Text classification with custom transformer block. -- [reuters_mlp_benchmark_test.py](https://github.com/keras-team/keras/blob/master/keras/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py): +- [reuters_mlp_benchmark_test.py](https://github.com/keras-team/tf-keras/blob/master/tf_keras/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py): Simple MLP on Reuters newswire topic classification dataset. #### Other examples -- [antirectifier_benchmark_test.py](https://github.com/keras-team/keras/blob/master/keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py): +- [antirectifier_benchmark_test.py](https://github.com/keras-team/tf-keras/blob/master/tf_keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py): Simple custom layer example. -- [mnist_irnn_benchmark_test.py](https://github.com/keras-team/keras/blob/master/keras/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py):Reproduction +- [mnist_irnn_benchmark_test.py](https://github.com/keras-team/tf-keras/blob/master/tf_keras/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py):Reproduction of the IRNN experiment with pixel-by-pixel sequential MNIST in ["A Simple Way to Initialize Recurrent Networks of Rectified Linear Units"](https://arxiv.org/abs/1504.00941) by Le et al. @@ -183,7 +183,7 @@ the installation. ## Run benchmarks To run benchmarks in -[keras/benchmarks](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/python/keras/benchmarks), +[keras/benchmarks](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/python/tf_keras/benchmarks), please take the following steps: 1. Pull the latest tensorflow repo from GitHub. @@ -222,9 +222,9 @@ To add a new benchmark, please take the following steps: 6. Define the benchmark_xxx method to measure the performance of benchmarks with different hyper parameters, such as `batch_size`, `run_iters`, `distribution_strategy` and etc. You can check examples from - [here](https://github.com/keras-team/keras/blob/master/keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py#L60). + [here](https://github.com/keras-team/tf-keras/blob/master/tf_keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py#L60). 7. Add the benchmark target to the - [BUILD](https://github.com/keras-team/keras/blob/master/keras/benchmarks/BUILD) + [BUILD](https://github.com/keras-team/tf-keras/blob/master/tf_keras/benchmarks/BUILD) file. ## Troubleshooting diff --git a/keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py b/tf_keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py similarity index 99% rename from keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py rename to tf_keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py index be16c0a2c..112da592d 100644 --- a/keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py +++ b/tf_keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py @@ -19,7 +19,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks import benchmark_util +from tf_keras.benchmarks import benchmark_util class AntirectifierBenchmark(tf.test.Benchmark): diff --git a/keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py b/tf_keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py similarity index 99% rename from keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py rename to tf_keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py index 771612a31..f4930d1f8 100644 --- a/keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py +++ b/tf_keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py @@ -19,7 +19,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks import benchmark_util +from tf_keras.benchmarks import benchmark_util class BidirectionalLSTMBenchmark(tf.test.Benchmark): diff --git a/keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py b/tf_keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py similarity index 97% rename from keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py rename to tf_keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py index cd8537cdd..348c573c3 100644 --- a/keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py +++ b/tf_keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py @@ -19,7 +19,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks import benchmark_util +from tf_keras.benchmarks import benchmark_util class Cifar10CNNBenchmark(tf.test.Benchmark): @@ -37,7 +37,7 @@ def __init__(self): def _build_model(self): """Model from - https://github.com/keras-team/keras/blob/master/examples/cifar10_cnn.py. + https://github.com/keras-team/tf-keras/blob/master/examples/cifar10_cnn.py. """ model = tf.keras.Sequential() model.add( diff --git a/keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py b/tf_keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py similarity index 99% rename from keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py rename to tf_keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py index fc5cedd27..84fe40b12 100644 --- a/keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py +++ b/tf_keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py @@ -20,7 +20,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.benchmarks import benchmark_util +from tf_keras.benchmarks import benchmark_util class ConvMnistBenchmark(tf.test.Benchmark): diff --git a/keras/benchmarks/keras_examples_benchmarks/mnist_conv_custom_training_benchmark_test.py b/tf_keras/benchmarks/keras_examples_benchmarks/mnist_conv_custom_training_benchmark_test.py similarity index 99% rename from keras/benchmarks/keras_examples_benchmarks/mnist_conv_custom_training_benchmark_test.py rename to tf_keras/benchmarks/keras_examples_benchmarks/mnist_conv_custom_training_benchmark_test.py index 70762325e..2c5e7a825 100644 --- a/keras/benchmarks/keras_examples_benchmarks/mnist_conv_custom_training_benchmark_test.py +++ b/tf_keras/benchmarks/keras_examples_benchmarks/mnist_conv_custom_training_benchmark_test.py @@ -22,8 +22,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.benchmarks import benchmark_util -from keras.benchmarks import distribution_util +from tf_keras.benchmarks import benchmark_util +from tf_keras.benchmarks import distribution_util class CustomMnistBenchmark(tf.test.Benchmark): diff --git a/keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py b/tf_keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py similarity index 97% rename from keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py rename to tf_keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py index 4103c3a3e..23a9ab54e 100644 --- a/keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py +++ b/tf_keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py @@ -19,7 +19,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks import benchmark_util +from tf_keras.benchmarks import benchmark_util class HierarchicalRNNBenchmark(tf.test.Benchmark): @@ -37,7 +37,7 @@ def __init__(self): ) def _build_model(self): - """Model from https://github.com/keras-team/keras/blob/master/examples + """Model from https://github.com/keras-team/tf-keras/blob/master/examples /mnist_hierarchical_rnn.py. """ diff --git a/keras/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py b/tf_keras/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py similarity index 98% rename from keras/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py rename to tf_keras/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py index 42dbfede4..4f91311e6 100644 --- a/keras/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py +++ b/tf_keras/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py @@ -19,7 +19,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks import benchmark_util +from tf_keras.benchmarks import benchmark_util class IRNNMnistBenchmark(tf.test.Benchmark): @@ -38,7 +38,7 @@ def __init__(self): ) def _build_model(self): - """Model from https://github.com/keras-team/keras/ + """Model from https://github.com/keras-team/tf-keras/ blob/master/examples/mnist_irnn.py. """ diff --git a/keras/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py b/tf_keras/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py similarity index 97% rename from keras/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py rename to tf_keras/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py index 39fc136c4..80410ed50 100644 --- a/keras/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py +++ b/tf_keras/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py @@ -20,7 +20,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.benchmarks import benchmark_util +from tf_keras.benchmarks import benchmark_util class MLPReutersBenchmark(tf.test.Benchmark): @@ -45,7 +45,7 @@ def __init__(self): self.epochs = 5 def _build_model(self): - """Model from https://github.com/keras-team/keras/blob/master/ + """Model from https://github.com/keras-team/tf-keras/blob/master/ examples/reuters_mlp.py. """ diff --git a/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py b/tf_keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py similarity index 98% rename from keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py rename to tf_keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py index 7277c955f..975c562bb 100644 --- a/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py +++ b/tf_keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py @@ -19,7 +19,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks import benchmark_util +from tf_keras.benchmarks import benchmark_util class TextWithTransformerBenchmark(tf.test.Benchmark): @@ -160,7 +160,7 @@ def benchmark_text_classification_bs_512_gpu_2(self): class MultiHeadSelfAttention(tf.keras.layers.Layer): - """Implement multi head self attention as a Keras layer.""" + """Implement multi head self attention as a TF-Keras layer.""" def __init__(self, embed_dim, num_heads=8): super().__init__() diff --git a/keras/benchmarks/layer_benchmarks/BUILD b/tf_keras/benchmarks/layer_benchmarks/BUILD similarity index 83% rename from keras/benchmarks/layer_benchmarks/BUILD rename to tf_keras/benchmarks/layer_benchmarks/BUILD index 809292c8c..86ce4b7f2 100644 --- a/keras/benchmarks/layer_benchmarks/BUILD +++ b/tf_keras/benchmarks/layer_benchmarks/BUILD @@ -1,11 +1,11 @@ # Description: -# Implementation of benchmarks on Keras layers. +# Implementation of benchmarks on TF-Keras layers. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = ["//visibility:public"], licenses = ["notice"], ) @@ -48,7 +48,7 @@ py_library( deps = [ ":run_xprof", "//:expect_tensorflow_installed", - "//keras/benchmarks:profiler_lib", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -60,7 +60,7 @@ tf_py_test( deps = [ ":layer_benchmarks_test_base", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:benchmark_util", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:benchmark_util", ], ) diff --git a/keras/benchmarks/layer_benchmarks/layer_benchmarks_test.py b/tf_keras/benchmarks/layer_benchmarks/layer_benchmarks_test.py similarity index 98% rename from keras/benchmarks/layer_benchmarks/layer_benchmarks_test.py rename to tf_keras/benchmarks/layer_benchmarks/layer_benchmarks_test.py index 42c5d17fa..50a022dfd 100644 --- a/keras/benchmarks/layer_benchmarks/layer_benchmarks_test.py +++ b/tf_keras/benchmarks/layer_benchmarks/layer_benchmarks_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Benchmarks on Keras layers.""" +"""Benchmarks on TF-Keras layers.""" from __future__ import absolute_import from __future__ import division @@ -23,8 +23,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.benchmarks import benchmark_util -from keras.benchmarks.layer_benchmarks import layer_benchmarks_test_base +from tf_keras.benchmarks import benchmark_util +from tf_keras.benchmarks.layer_benchmarks import layer_benchmarks_test_base def _get_metadata(name): diff --git a/keras/benchmarks/layer_benchmarks/layer_benchmarks_test_base.py b/tf_keras/benchmarks/layer_benchmarks/layer_benchmarks_test_base.py similarity index 95% rename from keras/benchmarks/layer_benchmarks/layer_benchmarks_test_base.py rename to tf_keras/benchmarks/layer_benchmarks/layer_benchmarks_test_base.py index d64e95c24..486d89973 100644 --- a/keras/benchmarks/layer_benchmarks/layer_benchmarks_test_base.py +++ b/tf_keras/benchmarks/layer_benchmarks/layer_benchmarks_test_base.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -r"""Benchmark base to run and report Keras layers benchmark results.""" +r"""Benchmark base to run and report TF-Keras layers benchmark results.""" from __future__ import absolute_import from __future__ import division @@ -22,7 +22,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks.layer_benchmarks import run_xprof +from tf_keras.benchmarks.layer_benchmarks import run_xprof class LayerBenchmarksBase(tf.test.Benchmark): diff --git a/keras/benchmarks/layer_benchmarks/run_xprof.py b/tf_keras/benchmarks/layer_benchmarks/run_xprof.py similarity index 100% rename from keras/benchmarks/layer_benchmarks/run_xprof.py rename to tf_keras/benchmarks/layer_benchmarks/run_xprof.py diff --git a/keras/benchmarks/metrics_memory_benchmark_test.py b/tf_keras/benchmarks/metrics_memory_benchmark_test.py similarity index 97% rename from keras/benchmarks/metrics_memory_benchmark_test.py rename to tf_keras/benchmarks/metrics_memory_benchmark_test.py index 2bc58d85e..177f6537c 100644 --- a/keras/benchmarks/metrics_memory_benchmark_test.py +++ b/tf_keras/benchmarks/metrics_memory_benchmark_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Benchmark tests for Keras metrics memory consumption.""" +"""Benchmark tests for TF-Keras metrics memory consumption.""" import numpy as np import tensorflow.compat.v2 as tf diff --git a/keras/benchmarks/model_components_benchmarks_test.py b/tf_keras/benchmarks/model_components_benchmarks_test.py similarity index 99% rename from keras/benchmarks/model_components_benchmarks_test.py rename to tf_keras/benchmarks/model_components_benchmarks_test.py index f10f07294..9a43e59fc 100644 --- a/keras/benchmarks/model_components_benchmarks_test.py +++ b/tf_keras/benchmarks/model_components_benchmarks_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -r"""Benchmarks on Keras components with different Keras model types.""" +r"""Benchmarks on TF-Keras components with different TF-Keras model types.""" import time diff --git a/keras/benchmarks/model_memory_profile.py b/tf_keras/benchmarks/model_memory_profile.py similarity index 97% rename from keras/benchmarks/model_memory_profile.py rename to tf_keras/benchmarks/model_memory_profile.py index 927c5fdb5..729389148 100644 --- a/keras/benchmarks/model_memory_profile.py +++ b/tf_keras/benchmarks/model_memory_profile.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Memory profile on Keras model. +"""Memory profile on TF-Keras model. To add a new model for memory profile: 1. Create the model. @@ -25,7 +25,7 @@ from absl import flags from absl import logging -import keras +import tf_keras as keras try: import memory_profiler diff --git a/keras/benchmarks/optimizer_benchmarks_test.py b/tf_keras/benchmarks/optimizer_benchmarks_test.py similarity index 95% rename from keras/benchmarks/optimizer_benchmarks_test.py rename to tf_keras/benchmarks/optimizer_benchmarks_test.py index 7156a1fa7..60cd362db 100644 --- a/keras/benchmarks/optimizer_benchmarks_test.py +++ b/tf_keras/benchmarks/optimizer_benchmarks_test.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Benchmark tests for Keras optimizers.""" +"""Benchmark tests for TF-Keras optimizers.""" import tensorflow.compat.v2 as tf -from keras.benchmarks import benchmark_util -from keras.optimizers.legacy import adam +from tf_keras.benchmarks import benchmark_util +from tf_keras.optimizers.legacy import adam # isort: off from tensorflow.python.platform.benchmark import ( diff --git a/keras/benchmarks/saved_model_benchmarks/BUILD b/tf_keras/benchmarks/saved_model_benchmarks/BUILD similarity index 78% rename from keras/benchmarks/saved_model_benchmarks/BUILD rename to tf_keras/benchmarks/saved_model_benchmarks/BUILD index 408dd37c9..39c103e38 100644 --- a/keras/benchmarks/saved_model_benchmarks/BUILD +++ b/tf_keras/benchmarks/saved_model_benchmarks/BUILD @@ -1,11 +1,11 @@ # Description: -# Implementation of Keras benchmarks. +# Implementation of TF-Keras benchmarks. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = ["//visibility:public"], licenses = ["notice"], ) @@ -29,7 +29,7 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/benchmarks:profiler_lib", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -43,8 +43,8 @@ cuda_py_test( deps = [ ":saved_model_benchmark_util", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -58,8 +58,8 @@ cuda_py_test( deps = [ ":saved_model_benchmark_util", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -73,8 +73,8 @@ cuda_py_test( deps = [ ":saved_model_benchmark_util", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -88,8 +88,8 @@ cuda_py_test( deps = [ ":saved_model_benchmark_util", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -103,8 +103,8 @@ cuda_py_test( deps = [ ":saved_model_benchmark_util", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -118,8 +118,8 @@ cuda_py_test( deps = [ ":saved_model_benchmark_util", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -133,8 +133,8 @@ cuda_py_test( deps = [ ":saved_model_benchmark_util", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:profiler_lib", ], ) @@ -148,7 +148,7 @@ cuda_py_test( deps = [ ":saved_model_benchmark_util", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/benchmarks:profiler_lib", + "//tf_keras/api:keras_api", + "//tf_keras/benchmarks:profiler_lib", ], ) diff --git a/keras/benchmarks/saved_model_benchmarks/densenet_benchmark_test.py b/tf_keras/benchmarks/saved_model_benchmarks/densenet_benchmark_test.py similarity index 94% rename from keras/benchmarks/saved_model_benchmarks/densenet_benchmark_test.py rename to tf_keras/benchmarks/saved_model_benchmarks/densenet_benchmark_test.py index bcc94015b..cb745ae30 100644 --- a/keras/benchmarks/saved_model_benchmarks/densenet_benchmark_test.py +++ b/tf_keras/benchmarks/saved_model_benchmarks/densenet_benchmark_test.py @@ -20,7 +20,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util +from tf_keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util class BenchmarkSaveApplications(tf.test.Benchmark): diff --git a/keras/benchmarks/saved_model_benchmarks/efficientnet_benchmark_test.py b/tf_keras/benchmarks/saved_model_benchmarks/efficientnet_benchmark_test.py similarity index 95% rename from keras/benchmarks/saved_model_benchmarks/efficientnet_benchmark_test.py rename to tf_keras/benchmarks/saved_model_benchmarks/efficientnet_benchmark_test.py index 62707cdcf..c97353105 100644 --- a/keras/benchmarks/saved_model_benchmarks/efficientnet_benchmark_test.py +++ b/tf_keras/benchmarks/saved_model_benchmarks/efficientnet_benchmark_test.py @@ -20,7 +20,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util +from tf_keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util class BenchmarkSaveApplications(tf.test.Benchmark): diff --git a/keras/benchmarks/saved_model_benchmarks/inception_resnet_v2_benchmark_test.py b/tf_keras/benchmarks/saved_model_benchmarks/inception_resnet_v2_benchmark_test.py similarity index 95% rename from keras/benchmarks/saved_model_benchmarks/inception_resnet_v2_benchmark_test.py rename to tf_keras/benchmarks/saved_model_benchmarks/inception_resnet_v2_benchmark_test.py index fd53786d7..ad76ace54 100644 --- a/keras/benchmarks/saved_model_benchmarks/inception_resnet_v2_benchmark_test.py +++ b/tf_keras/benchmarks/saved_model_benchmarks/inception_resnet_v2_benchmark_test.py @@ -20,7 +20,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util +from tf_keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util class BenchmarkSaveApplications(tf.test.Benchmark): diff --git a/keras/benchmarks/saved_model_benchmarks/mobilenet_benchmark_test.py b/tf_keras/benchmarks/saved_model_benchmarks/mobilenet_benchmark_test.py similarity index 94% rename from keras/benchmarks/saved_model_benchmarks/mobilenet_benchmark_test.py rename to tf_keras/benchmarks/saved_model_benchmarks/mobilenet_benchmark_test.py index bb00e7da0..c7fa4f5ac 100644 --- a/keras/benchmarks/saved_model_benchmarks/mobilenet_benchmark_test.py +++ b/tf_keras/benchmarks/saved_model_benchmarks/mobilenet_benchmark_test.py @@ -20,7 +20,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util +from tf_keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util class BenchmarkSaveApplications(tf.test.Benchmark): diff --git a/keras/benchmarks/saved_model_benchmarks/nasnet_large_benchmark_test.py b/tf_keras/benchmarks/saved_model_benchmarks/nasnet_large_benchmark_test.py similarity index 94% rename from keras/benchmarks/saved_model_benchmarks/nasnet_large_benchmark_test.py rename to tf_keras/benchmarks/saved_model_benchmarks/nasnet_large_benchmark_test.py index cd97d1d53..8246000e4 100644 --- a/keras/benchmarks/saved_model_benchmarks/nasnet_large_benchmark_test.py +++ b/tf_keras/benchmarks/saved_model_benchmarks/nasnet_large_benchmark_test.py @@ -20,7 +20,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util +from tf_keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util class BenchmarkSaveApplications(tf.test.Benchmark): diff --git a/keras/benchmarks/saved_model_benchmarks/resnet152_v2_benchmark_test.py b/tf_keras/benchmarks/saved_model_benchmarks/resnet152_v2_benchmark_test.py similarity index 94% rename from keras/benchmarks/saved_model_benchmarks/resnet152_v2_benchmark_test.py rename to tf_keras/benchmarks/saved_model_benchmarks/resnet152_v2_benchmark_test.py index bab2f5a60..9b4188f79 100644 --- a/keras/benchmarks/saved_model_benchmarks/resnet152_v2_benchmark_test.py +++ b/tf_keras/benchmarks/saved_model_benchmarks/resnet152_v2_benchmark_test.py @@ -20,7 +20,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util +from tf_keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util class BenchmarkSaveApplications(tf.test.Benchmark): diff --git a/keras/benchmarks/saved_model_benchmarks/saved_model_benchmark_util.py b/tf_keras/benchmarks/saved_model_benchmarks/saved_model_benchmark_util.py similarity index 98% rename from keras/benchmarks/saved_model_benchmarks/saved_model_benchmark_util.py rename to tf_keras/benchmarks/saved_model_benchmarks/saved_model_benchmark_util.py index 62271f0b7..d536d5053 100644 --- a/keras/benchmarks/saved_model_benchmarks/saved_model_benchmark_util.py +++ b/tf_keras/benchmarks/saved_model_benchmarks/saved_model_benchmark_util.py @@ -23,7 +23,7 @@ import tensorflow.compat.v2 as tf -import keras +import tf_keras as keras def save_and_load_benchmark(app): diff --git a/keras/benchmarks/saved_model_benchmarks/vgg_benchmark_test.py b/tf_keras/benchmarks/saved_model_benchmarks/vgg_benchmark_test.py similarity index 94% rename from keras/benchmarks/saved_model_benchmarks/vgg_benchmark_test.py rename to tf_keras/benchmarks/saved_model_benchmarks/vgg_benchmark_test.py index cdb044a1f..3fe18c81b 100644 --- a/keras/benchmarks/saved_model_benchmarks/vgg_benchmark_test.py +++ b/tf_keras/benchmarks/saved_model_benchmarks/vgg_benchmark_test.py @@ -20,7 +20,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util +from tf_keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util class BenchmarkSaveApplications(tf.test.Benchmark): diff --git a/keras/benchmarks/saved_model_benchmarks/xception_benchmark_test.py b/tf_keras/benchmarks/saved_model_benchmarks/xception_benchmark_test.py similarity index 94% rename from keras/benchmarks/saved_model_benchmarks/xception_benchmark_test.py rename to tf_keras/benchmarks/saved_model_benchmarks/xception_benchmark_test.py index ca9eb7c63..a38d0f961 100644 --- a/keras/benchmarks/saved_model_benchmarks/xception_benchmark_test.py +++ b/tf_keras/benchmarks/saved_model_benchmarks/xception_benchmark_test.py @@ -20,7 +20,7 @@ import tensorflow.compat.v2 as tf -from keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util +from tf_keras.benchmarks.saved_model_benchmarks import saved_model_benchmark_util class BenchmarkSaveApplications(tf.test.Benchmark): diff --git a/keras/callbacks.py b/tf_keras/callbacks.py similarity index 98% rename from keras/callbacks.py rename to tf_keras/callbacks.py index bc5a30805..f73237b80 100644 --- a/keras/callbacks.py +++ b/tf_keras/callbacks.py @@ -28,18 +28,18 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.distribute import distributed_file_utils -from keras.distribute import worker_training_state -from keras.optimizers import optimizer -from keras.optimizers.schedules import learning_rate_schedule -from keras.utils import generic_utils -from keras.utils import io_utils -from keras.utils import tf_utils -from keras.utils import version_utils -from keras.utils.data_utils import Sequence -from keras.utils.generic_utils import Progbar -from keras.utils.mode_keys import ModeKeys +from tf_keras import backend +from tf_keras.distribute import distributed_file_utils +from tf_keras.distribute import worker_training_state +from tf_keras.optimizers import optimizer +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.utils import generic_utils +from tf_keras.utils import io_utils +from tf_keras.utils import tf_utils +from tf_keras.utils import version_utils +from tf_keras.utils.data_utils import Sequence +from tf_keras.utils.generic_utils import Progbar +from tf_keras.utils.mode_keys import ModeKeys # isort: off from tensorflow.python.platform import tf_logging as logging @@ -76,7 +76,7 @@ def configure_callbacks( epochs: Number of epoch to train. steps_per_epoch: Number of batches to run per training epoch. samples: Number of training samples. - verbose: int, 0 or 1. Keras logging verbosity to pass to ProgbarLogger. + verbose: int, 0 or 1. TF-Keras logging verbosity to pass to ProgbarLogger. count_mode: One of 'steps' or 'samples'. Per-batch or per-sample count. mode: String. One of ModeKeys.TRAIN, ModeKeys.TEST, or ModeKeys.PREDICT. Which loop mode to configure callbacks for. @@ -140,7 +140,7 @@ def set_callback_parameters( epochs: Number of epoch to train. steps_per_epoch: Number of batches to run per training epoch. samples: Number of training samples. - verbose: int, 0 or 1. Keras logging verbosity to pass to ProgbarLogger. + verbose: int, 0 or 1. TF-Keras logging verbosity to pass to ProgbarLogger. mode: String. One of ModeKeys.TRAIN, ModeKeys.TEST, or ModeKeys.PREDICT. Which loop mode to configure callbacks for. """ @@ -628,7 +628,7 @@ class Callback: To create a custom callback, subclass `keras.callbacks.Callback` and override the method associated with the stage of interest. See - https://www.tensorflow.org/guide/keras/custom_callback for more information. + https://www.tensorflow.org/guide/tf_keras/custom_callback for more information. Example: @@ -937,7 +937,7 @@ def _implements_predict_batch_hooks(self): class BaseLogger(Callback): """Callback that accumulates epoch averages of metrics. - This callback is automatically applied to every Keras model. + This callback is automatically applied to every TF-Keras model. Args: stateful_metrics: Iterable of string names of metrics that @@ -1186,7 +1186,7 @@ class History(Callback): """Callback that records events into a `History` object. This callback is automatically applied to - every Keras model. The `History` object + every TF-Keras model. The `History` object gets returned by the `fit` method of models. Example: @@ -1223,7 +1223,7 @@ def on_epoch_end(self, epoch, logs=None): @keras_export("keras.callbacks.ModelCheckpoint") class ModelCheckpoint(Callback): - """Callback to save the Keras model or model weights at some frequency. + """Callback to save the TF-Keras model or model weights at some frequency. `ModelCheckpoint` callback is used in conjunction with training using `model.fit()` to save a model or weights (in a checkpoint file) at some @@ -1368,7 +1368,7 @@ def __init__( else: if filepath and filepath.endswith(".keras") and options is not None: raise ValueError( - "The native Keras format does not support " + "The native TF-Keras format does not support " "the `options` argument. Please remove " "the `options` argument, or use the SavedModel " "format by removing the `.keras` extension from " @@ -2290,16 +2290,16 @@ def on_epoch_end(self, epoch, logs=None): def keras_model_summary(name, data, step=None): - """Writes a Keras model as JSON to as a Summary. + """Writes a TF-Keras model as JSON to as a Summary. - Writing the Keras model configuration allows the TensorBoard graph plugin to + Writing the TF-Keras model configuration allows the TensorBoard graph plugin to render a conceptual graph, as opposed to graph of ops. In case the model fails to serialize as JSON, it ignores and returns False. Args: name: A name for this summary. The summary tag used for TensorBoard will be this name prefixed by any active name scopes. - data: A Keras Model to write. + data: A TF-Keras Model to write. step: Explicit `int64`-castable monotonic step value for this summary. If omitted, this defaults to `tf.summary.experimental.get_step()`, which must not be None. @@ -2353,7 +2353,7 @@ class TensorBoard(Callback, version_utils.TensorBoardVersionSelector): * Sampled profiling When used in `Model.evaluate` or regular validation - ([on_test_end](https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/Callback#on_test_end)), + ([on_test_end](https://www.tensorflow.org/api_docs/python/tf/tf_keras/callbacks/Callback#on_test_end)), in addition to epoch summaries, there will be a summary that records evaluation metrics vs `Model.optimizer.iterations` written. The metric names will be prepended with `evaluation`, with `Model.optimizer.iterations` being @@ -2558,7 +2558,7 @@ def _validate_kwargs(self, kwargs): ) def set_model(self, model): - """Sets Keras model and writes graph if specified.""" + """Sets TF-Keras model and writes graph if specified.""" self.model = model self._log_write_dir = self._get_log_write_dir() @@ -2604,7 +2604,7 @@ def _delete_tmp_write_dir(self): ) def _write_keras_model_train_graph(self): - """Writes Keras model train_function graph to TensorBoard.""" + """Writes TF-Keras model train_function graph to TensorBoard.""" with self._train_writer.as_default(): with tf.summary.record_if(True): train_fn = self.model.train_tf_function @@ -2616,7 +2616,7 @@ def _write_keras_model_train_graph(self): ) def _write_keras_model_summary(self): - """Writes Keras graph network summary to TensorBoard.""" + """Writes TF-Keras graph network summary to TensorBoard.""" with self._train_writer.as_default(): with tf.summary.record_if(True): summary_writable = ( @@ -2624,13 +2624,13 @@ def _write_keras_model_summary(self): or self.model.__class__.__name__ == "Sequential" ) if summary_writable: - keras_model_summary("keras", self.model, step=0) + keras_model_summary("tf_keras", self.model, step=0) def _configure_embeddings(self): """Configure the Projector for embeddings.""" # TODO(omalleyt): Add integration tests. - from keras.layers import core - from keras.protobuf import projector_config_pb2 + from tf_keras.layers import core + from tf_keras.protobuf import projector_config_pb2 # isort: off from google.protobuf import text_format diff --git a/keras/callbacks_test.py b/tf_keras/callbacks_test.py similarity index 99% rename from keras/callbacks_test.py rename to tf_keras/callbacks_test.py index f0e269141..78cc07799 100644 --- a/keras/callbacks_test.py +++ b/tf_keras/callbacks_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras callbacks.""" +"""Tests for TF-Keras callbacks.""" import collections @@ -31,21 +31,21 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.callbacks import BackupAndRestore -from keras.callbacks import BackupAndRestoreExperimental -from keras.callbacks import Callback -from keras.engine import sequential -from keras.layers import Activation -from keras.layers import Dense -from keras.optimizers import sgd -from keras.optimizers.legacy import gradient_descent -from keras.optimizers.schedules import learning_rate_schedule -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import io_utils -from keras.utils import np_utils -from keras.utils import tf_utils +import tf_keras as keras +from tf_keras.callbacks import BackupAndRestore +from tf_keras.callbacks import BackupAndRestoreExperimental +from tf_keras.callbacks import Callback +from tf_keras.engine import sequential +from tf_keras.layers import Activation +from tf_keras.layers import Dense +from tf_keras.optimizers import sgd +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import io_utils +from tf_keras.utils import np_utils +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -1667,7 +1667,7 @@ def test_ModelCheckpoint_KerasV3_save_options_error(self): filepath = os.path.join(temp_dir, "temp.keras") with self.assertRaisesRegex( - ValueError, "The native Keras format does not support" + ValueError, "The native TF-Keras format does not support" ): _ = keras.callbacks.ModelCheckpoint( filepath=filepath, options=tf.saved_model.SaveOptions() @@ -3067,7 +3067,7 @@ def list_summaries(logdir): for value in event.summary.value: tag = value.tag # Case on the `value` rather than the summary metadata - # because the Keras callback uses `summary_ops_v2` to emit + # because the TF-Keras callback uses `summary_ops_v2` to emit # old-style summaries. See b/124535134. kind = value.WhichOneof("value") container = { @@ -3081,7 +3081,7 @@ def list_summaries(logdir): "Unexpected summary kind %r in event file %s:\n%r" % (kind, path, event) ) - elif kind == "tensor" and tag != "keras": + elif kind == "tensor" and tag != "tf_keras": # Convert the tf2 summary proto to old style for type # checking. plugin_name = value.metadata.plugin_data.plugin_name @@ -3624,7 +3624,7 @@ def fitModelAndAssertKerasModelWritten(self, model): self.assertEqual( summary_file.tensors, { - _ObservedSummary(logdir=self.train_dir, tag="keras"), + _ObservedSummary(logdir=self.train_dir, tag="tf_keras"), }, ) if not model.run_eagerly: diff --git a/keras/callbacks_v1.py b/tf_keras/callbacks_v1.py similarity index 99% rename from keras/callbacks_v1.py rename to tf_keras/callbacks_v1.py index 013b7bcad..c94652a38 100644 --- a/keras/callbacks_v1.py +++ b/tf_keras/callbacks_v1.py @@ -21,8 +21,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import callbacks +from tf_keras import backend +from tf_keras import callbacks # isort: off from tensorflow.python.platform import tf_logging as logging @@ -243,7 +243,7 @@ def is_indexed_slices(grad): ) def set_model(self, model): - """Sets Keras model and creates summary ops.""" + """Sets TF-Keras model and creates summary ops.""" self.model = model self._init_writer(model) @@ -256,7 +256,7 @@ def set_model(self, model): # visualize embeddings. if self.embeddings_freq and self.embeddings_data is not None: # Avoid circular dependency. - from keras.engine import ( + from tf_keras.engine import ( training_utils_v1, ) diff --git a/keras/callbacks_v1_test.py b/tf_keras/callbacks_v1_test.py similarity index 98% rename from keras/callbacks_v1_test.py rename to tf_keras/callbacks_v1_test.py index b46c6e9f1..d888306c8 100644 --- a/keras/callbacks_v1_test.py +++ b/tf_keras/callbacks_v1_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras callbacks.""" +"""Tests for TF-Keras callbacks.""" import os import shutil @@ -22,15 +22,15 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import callbacks -from keras import callbacks_v1 -from keras import layers -from keras.engine import input_layer -from keras.engine import sequential -from keras.engine import training -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import np_utils +from tf_keras import callbacks +from tf_keras import callbacks_v1 +from tf_keras import layers +from tf_keras.engine import input_layer +from tf_keras.engine import sequential +from tf_keras.engine import training +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import np_utils TRAIN_SAMPLES = 10 TEST_SAMPLES = 10 diff --git a/keras/constraints.py b/tf_keras/constraints.py similarity index 97% rename from keras/constraints.py rename to tf_keras/constraints.py index 4a25f5a3d..0a8bf15d2 100644 --- a/keras/constraints.py +++ b/tf_keras/constraints.py @@ -20,10 +20,10 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.saving.legacy import serialization as legacy_serialization -from keras.saving.serialization_lib import deserialize_keras_object -from keras.saving.serialization_lib import serialize_keras_object +from tf_keras import backend +from tf_keras.saving.legacy import serialization as legacy_serialization +from tf_keras.saving.serialization_lib import deserialize_keras_object +from tf_keras.saving.serialization_lib import serialize_keras_object # isort: off from tensorflow.python.util.tf_export import keras_export @@ -392,7 +392,7 @@ def deserialize(config, custom_objects=None, use_legacy_format=False): @keras_export("keras.constraints.get") def get(identifier): - """Retrieves a Keras constraint function.""" + """Retrieves a TF-Keras constraint function.""" if identifier is None: return None if isinstance(identifier, dict): diff --git a/keras/constraints_test.py b/tf_keras/constraints_test.py similarity index 96% rename from keras/constraints_test.py rename to tf_keras/constraints_test.py index b0fdb95b4..59bb59cfe 100644 --- a/keras/constraints_test.py +++ b/tf_keras/constraints_test.py @@ -12,16 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras weights constraints.""" +"""Tests for TF-Keras weights constraints.""" import math import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import constraints -from keras.testing_infra import test_combinations +from tf_keras import backend +from tf_keras import constraints +from tf_keras.testing_infra import test_combinations def get_test_values(): diff --git a/keras/datasets/BUILD b/tf_keras/datasets/BUILD similarity index 68% rename from keras/datasets/BUILD rename to tf_keras/datasets/BUILD index 325aff5ed..fa29f4877 100644 --- a/keras/datasets/BUILD +++ b/tf_keras/datasets/BUILD @@ -1,12 +1,12 @@ # Description: -# Contains the Keras datasets package (internal TensorFlow version). +# Contains the TF-Keras datasets package (internal TensorFlow version). # Placeholder: load unaliased py_library package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", ], licenses = ["notice"], ) @@ -29,7 +29,7 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/utils:engine_utils", + "//tf_keras:backend", + "//tf_keras/utils:engine_utils", ], ) diff --git a/keras/datasets/__init__.py b/tf_keras/datasets/__init__.py similarity index 100% rename from keras/datasets/__init__.py rename to tf_keras/datasets/__init__.py diff --git a/keras/datasets/boston_housing.py b/tf_keras/datasets/boston_housing.py similarity index 98% rename from keras/datasets/boston_housing.py rename to tf_keras/datasets/boston_housing.py index 08a31e346..dab2c1c4d 100644 --- a/keras/datasets/boston_housing.py +++ b/tf_keras/datasets/boston_housing.py @@ -16,7 +16,7 @@ import numpy as np -from keras.utils.data_utils import get_file +from tf_keras.utils.data_utils import get_file # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/datasets/cifar.py b/tf_keras/datasets/cifar.py similarity index 100% rename from keras/datasets/cifar.py rename to tf_keras/datasets/cifar.py diff --git a/keras/datasets/cifar10.py b/tf_keras/datasets/cifar10.py similarity index 96% rename from keras/datasets/cifar10.py rename to tf_keras/datasets/cifar10.py index 5131d2a69..daab65443 100644 --- a/keras/datasets/cifar10.py +++ b/tf_keras/datasets/cifar10.py @@ -18,9 +18,9 @@ import numpy as np -from keras import backend -from keras.datasets.cifar import load_batch -from keras.utils.data_utils import get_file +from tf_keras import backend +from tf_keras.datasets.cifar import load_batch +from tf_keras.utils.data_utils import get_file # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/datasets/cifar100.py b/tf_keras/datasets/cifar100.py similarity index 96% rename from keras/datasets/cifar100.py rename to tf_keras/datasets/cifar100.py index e910b0051..af00173d1 100644 --- a/keras/datasets/cifar100.py +++ b/tf_keras/datasets/cifar100.py @@ -18,9 +18,9 @@ import numpy as np -from keras import backend -from keras.datasets.cifar import load_batch -from keras.utils.data_utils import get_file +from tf_keras import backend +from tf_keras.datasets.cifar import load_batch +from tf_keras.utils.data_utils import get_file # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/datasets/fashion_mnist.py b/tf_keras/datasets/fashion_mnist.py similarity index 98% rename from keras/datasets/fashion_mnist.py rename to tf_keras/datasets/fashion_mnist.py index e7d64ebef..a3040cea5 100644 --- a/keras/datasets/fashion_mnist.py +++ b/tf_keras/datasets/fashion_mnist.py @@ -19,7 +19,7 @@ import numpy as np -from keras.utils.data_utils import get_file +from tf_keras.utils.data_utils import get_file # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/datasets/imdb.py b/tf_keras/datasets/imdb.py similarity index 98% rename from keras/datasets/imdb.py rename to tf_keras/datasets/imdb.py index 1e61771ad..2810fe20b 100644 --- a/keras/datasets/imdb.py +++ b/tf_keras/datasets/imdb.py @@ -18,8 +18,8 @@ import numpy as np -from keras.preprocessing.sequence import _remove_long_seq -from keras.utils.data_utils import get_file +from tf_keras.preprocessing.sequence import _remove_long_seq +from tf_keras.utils.data_utils import get_file # isort: off from tensorflow.python.platform import tf_logging as logging diff --git a/keras/datasets/mnist.py b/tf_keras/datasets/mnist.py similarity index 98% rename from keras/datasets/mnist.py rename to tf_keras/datasets/mnist.py index a145d167a..d98b7cb98 100644 --- a/keras/datasets/mnist.py +++ b/tf_keras/datasets/mnist.py @@ -16,7 +16,7 @@ import numpy as np -from keras.utils.data_utils import get_file +from tf_keras.utils.data_utils import get_file # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/datasets/reuters.py b/tf_keras/datasets/reuters.py similarity index 97% rename from keras/datasets/reuters.py rename to tf_keras/datasets/reuters.py index 38cc15e33..e0b7ce480 100644 --- a/keras/datasets/reuters.py +++ b/tf_keras/datasets/reuters.py @@ -18,8 +18,8 @@ import numpy as np -from keras.preprocessing.sequence import _remove_long_seq -from keras.utils.data_utils import get_file +from tf_keras.preprocessing.sequence import _remove_long_seq +from tf_keras.utils.data_utils import get_file # isort: off from tensorflow.python.platform import tf_logging as logging @@ -45,8 +45,8 @@ def load_data( This was originally generated by parsing and preprocessing the classic Reuters-21578 dataset, but the preprocessing code is no longer packaged - with Keras. See this - [GitHub discussion](https://github.com/keras-team/keras/issues/12072) + with TF-Keras. See this + [GitHub discussion](https://github.com/keras-team/tf-keras/issues/12072) for more info. Each newswire is encoded as a list of word indexes (integers). diff --git a/keras/distribute/BUILD b/tf_keras/distribute/BUILD similarity index 84% rename from keras/distribute/BUILD rename to tf_keras/distribute/BUILD index 7c5d1c047..40ebf8884 100644 --- a/keras/distribute/BUILD +++ b/tf_keras/distribute/BUILD @@ -1,17 +1,17 @@ # Description: # keras/distribute package is intended to serve as the centralized place for things -# related to dist-strat used by Keras.. +# related to dist-strat used by TF-Keras.. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "distribute_py_test") -load("@org_keras//keras:keras.bzl", "cuda_py_test") -load("@org_keras//keras:keras.bzl", "tf_py_test") # buildifier: disable=same-origin-load +load("@org_keras//tf_keras:tf_keras.bzl", "distribute_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") # buildifier: disable=same-origin-load package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], # TODO(scottzhu): Remove this deps when distribute test are converted to integration test. default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/tensorflow/python/distribute:__pkg__", "//third_party/tensorflow/tools/pip_package:__pkg__", ], @@ -29,17 +29,17 @@ py_library( deps = [ ":distribute_coordinator_utils", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras:callbacks", - "//keras:callbacks_v1", - "//keras:constraints", - "//keras:losses", - "//keras:regularizers", - "//keras/initializers", - "//keras/mixed_precision:policy", - "//keras/optimizers", - "//keras/utils:engine_utils", - "//keras/utils:mode_keys", + "//tf_keras:backend", + "//tf_keras:callbacks", + "//tf_keras:callbacks_v1", + "//tf_keras:constraints", + "//tf_keras:losses", + "//tf_keras:regularizers", + "//tf_keras/initializers", + "//tf_keras/mixed_precision:policy", + "//tf_keras/optimizers", + "//tf_keras/utils:engine_utils", + "//tf_keras/utils:mode_keys", ], ) @@ -64,8 +64,8 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/optimizers", - "//keras/optimizers/legacy:optimizers", + "//tf_keras/optimizers", + "//tf_keras/optimizers/legacy:optimizers", ], ) @@ -78,8 +78,8 @@ py_library( deps = [ ":distributed_file_utils", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/utils:mode_keys", + "//tf_keras:backend", + "//tf_keras/utils:mode_keys", ], ) @@ -106,7 +106,7 @@ py_library( deps = [ ":model_collection_base", "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -118,7 +118,7 @@ py_library( ":model_combinations", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_utils", + "//tf_keras/testing_infra:test_utils", ], ) @@ -131,7 +131,7 @@ cuda_py_test( ":multi_worker_testing_utils", ":worker_training_state", "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -144,7 +144,7 @@ cuda_py_test( ":multi_worker_testing_utils", ":worker_training_state", "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -158,7 +158,7 @@ distribute_py_test( ], deps = [ "//:expect_tensorflow_installed", - "//keras/optimizers/legacy:optimizers", + "//tf_keras/optimizers/legacy:optimizers", ], ) @@ -174,14 +174,14 @@ cuda_py_test( # b/155301154 broken with XLA:GPU xla_enable_strict_auto_jit = True, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_portpicker_installed", "//:expect_tensorflow_installed", - "//keras/engine", - "//keras/layers", - "//keras/mixed_precision:policy", - "//keras/mixed_precision:test_util", - "//keras/testing_infra:test_utils", + "//tf_keras/engine", + "//tf_keras/layers", + "//tf_keras/mixed_precision:policy", + "//tf_keras/mixed_precision:test_util", + "//tf_keras/testing_infra:test_utils", ], ) @@ -203,8 +203,8 @@ distribute_py_test( ":strategy_combinations", "//:expect_portpicker_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_utils", ], ) @@ -219,10 +219,10 @@ distribute_py_test( ], deps = [ ":strategy_combinations", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_portpicker_installed", "//:expect_tensorflow_installed", - "//keras/metrics", + "//tf_keras/metrics", ], ) @@ -242,10 +242,10 @@ distribute_py_test( ], deps = [ ":strategy_combinations", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_portpicker_installed", "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -260,9 +260,9 @@ distribute_py_test( ], deps = [ ":strategy_combinations", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/optimizers/legacy:optimizers", + "//tf_keras/optimizers/legacy:optimizers", ], ) @@ -276,11 +276,11 @@ py_library( ":multi_worker_testing_utils", ":optimizer_combinations", ":strategy_combinations", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -349,7 +349,7 @@ distribute_py_test( ":distribute", ":distribute_strategy_test_lib", "//:expect_tensorflow_installed", - "//keras:callbacks", + "//tf_keras:callbacks", ], ) @@ -366,12 +366,12 @@ py_library( srcs_version = "PY3", deps = [ ":strategy_combinations", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras:backend", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras:backend", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -462,9 +462,9 @@ distribute_py_test( "nomultivm", # TODO(b/170502145) ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/metrics", + "//tf_keras/metrics", ], ) @@ -479,9 +479,9 @@ distribute_py_test( ], deps = [ ":strategy_combinations", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -524,7 +524,7 @@ distribute_py_test( ], deps = [ ":saved_model_test_base", - "//keras/saving", + "//tf_keras/saving", ], ) @@ -579,10 +579,10 @@ py_library( ], srcs_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -611,10 +611,10 @@ distribute_py_test( deps = [ ":optimizer_combinations", ":test_example", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/layers", + "//tf_keras/layers", ], ) @@ -628,9 +628,9 @@ cuda_py_test( ], deps = [ "//:expect_tensorflow_installed", - "//keras/engine", - "//keras/layers/core", - "//keras/utils:kpl_test_utils", + "//tf_keras/engine", + "//tf_keras/layers/core", + "//tf_keras/utils:kpl_test_utils", ], ) @@ -644,8 +644,8 @@ cuda_py_test( ], deps = [ "//:expect_tensorflow_installed", - "//keras/layers/core", - "//keras/metrics", + "//tf_keras/layers/core", + "//tf_keras/metrics", ], ) @@ -660,16 +660,16 @@ cuda_py_test( ], deps = [ ":multi_worker_testing_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_portpicker_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras:backend", - "//keras:callbacks", - "//keras:engine", - "//keras/optimizers", - "//keras/optimizers/legacy:optimizers", - "//keras/utils:kpl_test_utils", + "//tf_keras", + "//tf_keras:backend", + "//tf_keras:callbacks", + "//tf_keras:engine", + "//tf_keras/optimizers", + "//tf_keras/optimizers/legacy:optimizers", + "//tf_keras/utils:kpl_test_utils", ], ) @@ -697,8 +697,8 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/optimizers/legacy:optimizers", + "//tf_keras", + "//tf_keras/optimizers/legacy:optimizers", ], ) @@ -745,7 +745,7 @@ distribute_py_test( deps = [ ":saved_model_test_base", "//:expect_tensorflow_installed", - "//keras/saving", + "//tf_keras/saving", ], ) @@ -764,7 +764,7 @@ distribute_py_test( ":strategy_combinations", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/engine:base_layer", + "//tf_keras/engine:base_layer", ], ) @@ -783,9 +783,9 @@ distribute_py_test( ], deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_utils", - "//keras/utils:dataset_creator", + "//tf_keras", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:dataset_creator", ], ) @@ -804,9 +804,9 @@ distribute_py_test( ], deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_utils", - "//keras/utils:dataset_creator", + "//tf_keras", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:dataset_creator", ], ) @@ -831,8 +831,8 @@ distribute_py_test( ":strategy_combinations", "//:expect_portpicker_installed", "//:expect_tensorflow_installed", - "//keras:callbacks", - "//keras/testing_infra:test_utils", + "//tf_keras:callbacks", + "//tf_keras/testing_infra:test_utils", ], ) @@ -855,8 +855,8 @@ distribute_py_test( ":dataset_creator_model_fit_test_base", ":strategy_combinations", "//:expect_tensorflow_installed", - "//keras:callbacks", - "//keras/testing_infra:test_utils", + "//tf_keras:callbacks", + "//tf_keras/testing_infra:test_utils", ], ) @@ -897,7 +897,7 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/legacy_tf_layers:layers", + "//tf_keras/legacy_tf_layers:layers", ], ) @@ -918,14 +918,14 @@ py_library( srcs_version = "PY3", deps = [ ":multi_worker_testing_utils", - "//:expect_absl_installed", - "//:expect_tensorflow_installed", - "//keras", - "//keras:callbacks", - "//keras/engine", - "//keras/layers/core", - "//keras/layers/preprocessing:string_lookup", - "//keras/optimizers/legacy:optimizers", - "//keras/utils:dataset_creator", + "//:expect_absl_installed", # absl/testing:parameterized + "//:expect_tensorflow_installed", + "//tf_keras", + "//tf_keras:callbacks", + "//tf_keras/engine", + "//tf_keras/layers/core", + "//tf_keras/layers/preprocessing:string_lookup", + "//tf_keras/optimizers/legacy:optimizers", + "//tf_keras/utils:dataset_creator", ], ) diff --git a/tf_keras/distribute/README.md b/tf_keras/distribute/README.md new file mode 100644 index 000000000..9e223d80d --- /dev/null +++ b/tf_keras/distribute/README.md @@ -0,0 +1,6 @@ +# TF-Keras with Distribution Strategy Tests + +This directory contains unit tests that combine TF-Keras library with +[Distribution Training](https://www.tensorflow.org/guide/distributed_training). +Tests that use a custom training loop instead of TF-Keras compile/fit should be +placed under python/distribute directory instead. diff --git a/keras/distribute/__init__.py b/tf_keras/distribute/__init__.py similarity index 100% rename from keras/distribute/__init__.py rename to tf_keras/distribute/__init__.py diff --git a/keras/distribute/checkpointing_test.py b/tf_keras/distribute/checkpointing_test.py similarity index 99% rename from keras/distribute/checkpointing_test.py rename to tf_keras/distribute/checkpointing_test.py index a3d586fbc..8e785c262 100644 --- a/keras/distribute/checkpointing_test.py +++ b/tf_keras/distribute/checkpointing_test.py @@ -18,7 +18,7 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.optimizers.legacy import adam +from tf_keras.optimizers.legacy import adam class TrainingCheckpointTests(tf.test.TestCase, parameterized.TestCase): diff --git a/keras/distribute/collective_all_reduce_strategy_test.py b/tf_keras/distribute/collective_all_reduce_strategy_test.py similarity index 93% rename from keras/distribute/collective_all_reduce_strategy_test.py rename to tf_keras/distribute/collective_all_reduce_strategy_test.py index 42992cef3..22e50ae59 100644 --- a/keras/distribute/collective_all_reduce_strategy_test.py +++ b/tf_keras/distribute/collective_all_reduce_strategy_test.py @@ -17,10 +17,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import layers -from keras.engine import training -from keras.optimizers.legacy import gradient_descent as gradient_descent_keras -from keras.testing_infra import test_utils +from tf_keras import layers +from tf_keras.engine import training +from tf_keras.optimizers.legacy import gradient_descent as gradient_descent_keras +from tf_keras.testing_infra import test_utils @test_utils.run_v2_only diff --git a/keras/distribute/ctl_correctness_test.py b/tf_keras/distribute/ctl_correctness_test.py similarity index 98% rename from keras/distribute/ctl_correctness_test.py rename to tf_keras/distribute/ctl_correctness_test.py index 48b15e8fb..013b68324 100644 --- a/keras/distribute/ctl_correctness_test.py +++ b/tf_keras/distribute/ctl_correctness_test.py @@ -18,13 +18,13 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import optimizers -from keras.applications import resnet_v2 -from keras.datasets import fashion_mnist -from keras.distribute import optimizer_combinations -from keras.distribute import strategy_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras import optimizers +from tf_keras.applications import resnet_v2 +from tf_keras.datasets import fashion_mnist +from tf_keras.distribute import optimizer_combinations +from tf_keras.distribute import strategy_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.ops.losses import losses_impl diff --git a/keras/distribute/custom_training_loop_metrics_test.py b/tf_keras/distribute/custom_training_loop_metrics_test.py similarity index 98% rename from keras/distribute/custom_training_loop_metrics_test.py rename to tf_keras/distribute/custom_training_loop_metrics_test.py index a48a7d6b1..24af991cf 100644 --- a/keras/distribute/custom_training_loop_metrics_test.py +++ b/tf_keras/distribute/custom_training_loop_metrics_test.py @@ -18,8 +18,8 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import metrics -from keras.distribute import strategy_combinations +from tf_keras import metrics +from tf_keras.distribute import strategy_combinations # isort: off from tensorflow.python.framework import ( diff --git a/keras/distribute/custom_training_loop_models_test.py b/tf_keras/distribute/custom_training_loop_models_test.py similarity index 99% rename from keras/distribute/custom_training_loop_models_test.py rename to tf_keras/distribute/custom_training_loop_models_test.py index cdcd869b9..723fcbdc6 100644 --- a/keras/distribute/custom_training_loop_models_test.py +++ b/tf_keras/distribute/custom_training_loop_models_test.py @@ -20,10 +20,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.distribute import strategy_combinations -from keras.layers import core -from keras.optimizers.legacy import gradient_descent +import tf_keras as keras +from tf_keras.distribute import strategy_combinations +from tf_keras.layers import core +from tf_keras.optimizers.legacy import gradient_descent class CustomModel(tf.Module): diff --git a/keras/distribute/custom_training_loop_optimizer_test.py b/tf_keras/distribute/custom_training_loop_optimizer_test.py similarity index 98% rename from keras/distribute/custom_training_loop_optimizer_test.py rename to tf_keras/distribute/custom_training_loop_optimizer_test.py index c972b96a2..a712be88a 100644 --- a/keras/distribute/custom_training_loop_optimizer_test.py +++ b/tf_keras/distribute/custom_training_loop_optimizer_test.py @@ -17,10 +17,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.distribute import ( +from tf_keras.distribute import ( strategy_combinations as keras_strategy_combinations, ) -from keras.optimizers.legacy import gradient_descent +from tf_keras.optimizers.legacy import gradient_descent # isort: off from tensorflow.python.distribute import values diff --git a/keras/distribute/dataset_creator_model_fit_ps_only_test.py b/tf_keras/distribute/dataset_creator_model_fit_ps_only_test.py similarity index 96% rename from keras/distribute/dataset_creator_model_fit_ps_only_test.py rename to tf_keras/distribute/dataset_creator_model_fit_ps_only_test.py index 077ff1510..6b1ccafcb 100644 --- a/keras/distribute/dataset_creator_model_fit_ps_only_test.py +++ b/tf_keras/distribute/dataset_creator_model_fit_ps_only_test.py @@ -16,10 +16,10 @@ import tensorflow.compat.v2 as tf -from keras import callbacks as callbacks_lib -from keras.distribute import dataset_creator_model_fit_test_base as test_base -from keras.distribute import strategy_combinations -from keras.testing_infra import test_utils +from tf_keras import callbacks as callbacks_lib +from tf_keras.distribute import dataset_creator_model_fit_test_base as test_base +from tf_keras.distribute import strategy_combinations +from tf_keras.testing_infra import test_utils @test_utils.run_v2_only diff --git a/keras/distribute/dataset_creator_model_fit_test.py b/tf_keras/distribute/dataset_creator_model_fit_test.py similarity index 98% rename from keras/distribute/dataset_creator_model_fit_test.py rename to tf_keras/distribute/dataset_creator_model_fit_test.py index c6b36be62..c2cb2746d 100644 --- a/keras/distribute/dataset_creator_model_fit_test.py +++ b/tf_keras/distribute/dataset_creator_model_fit_test.py @@ -17,10 +17,10 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.distribute import dataset_creator_model_fit_test_base as test_base -from keras.distribute import strategy_combinations -from keras.testing_infra import test_utils -from keras.utils import dataset_creator +from tf_keras.distribute import dataset_creator_model_fit_test_base as test_base +from tf_keras.distribute import strategy_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import dataset_creator # isort: off from tensorflow.python.framework import ( diff --git a/keras/distribute/dataset_creator_model_fit_test_base.py b/tf_keras/distribute/dataset_creator_model_fit_test_base.py similarity index 96% rename from keras/distribute/dataset_creator_model_fit_test_base.py rename to tf_keras/distribute/dataset_creator_model_fit_test_base.py index e7318fdf3..e8af86282 100644 --- a/keras/distribute/dataset_creator_model_fit_test_base.py +++ b/tf_keras/distribute/dataset_creator_model_fit_test_base.py @@ -20,13 +20,13 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import callbacks as callbacks_lib -from keras.engine import sequential -from keras.layers import core as core_layers -from keras.layers.preprocessing import string_lookup -from keras.optimizers.legacy import gradient_descent -from keras.utils import dataset_creator +import tf_keras as keras +from tf_keras import callbacks as callbacks_lib +from tf_keras.engine import sequential +from tf_keras.layers import core as core_layers +from tf_keras.layers.preprocessing import string_lookup +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.utils import dataset_creator # isort: off from tensorflow.python.platform import tf_logging as logging diff --git a/keras/distribute/distribute_coordinator_utils.py b/tf_keras/distribute/distribute_coordinator_utils.py similarity index 100% rename from keras/distribute/distribute_coordinator_utils.py rename to tf_keras/distribute/distribute_coordinator_utils.py diff --git a/keras/distribute/distribute_strategy_test.py b/tf_keras/distribute/distribute_strategy_test.py similarity index 99% rename from keras/distribute/distribute_strategy_test.py rename to tf_keras/distribute/distribute_strategy_test.py index 5931f4cc7..cae08a002 100644 --- a/keras/distribute/distribute_strategy_test.py +++ b/tf_keras/distribute/distribute_strategy_test.py @@ -20,28 +20,28 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import backend -from keras.distribute import distributed_training_utils -from keras.distribute import distributed_training_utils_v1 -from keras.distribute import multi_worker_testing_utils -from keras.distribute import optimizer_combinations -from keras.distribute.strategy_combinations import all_strategies -from keras.distribute.strategy_combinations import ( +import tf_keras as keras +from tf_keras import backend +from tf_keras.distribute import distributed_training_utils +from tf_keras.distribute import distributed_training_utils_v1 +from tf_keras.distribute import multi_worker_testing_utils +from tf_keras.distribute import optimizer_combinations +from tf_keras.distribute.strategy_combinations import all_strategies +from tf_keras.distribute.strategy_combinations import ( multi_worker_mirrored_strategies, ) -from keras.distribute.strategy_combinations import ( +from tf_keras.distribute.strategy_combinations import ( strategies_minus_default_minus_tpu, ) -from keras.distribute.strategy_combinations import strategies_minus_tpu -from keras.distribute.strategy_combinations import tpu_strategies -from keras.engine import base_layer_utils -from keras.mixed_precision import policy -from keras.optimizers import optimizer as optimizer_base -from keras.optimizers.legacy import gradient_descent as gradient_descent_keras -from keras.testing_infra import test_utils -from keras.utils import losses_utils -from keras.utils import np_utils +from tf_keras.distribute.strategy_combinations import strategies_minus_tpu +from tf_keras.distribute.strategy_combinations import tpu_strategies +from tf_keras.engine import base_layer_utils +from tf_keras.mixed_precision import policy +from tf_keras.optimizers import optimizer as optimizer_base +from tf_keras.optimizers.legacy import gradient_descent as gradient_descent_keras +from tf_keras.testing_infra import test_utils +from tf_keras.utils import losses_utils +from tf_keras.utils import np_utils # isort: off from tensorflow.python.distribute.cluster_resolver import ( diff --git a/keras/distribute/distributed_file_utils.py b/tf_keras/distribute/distributed_file_utils.py similarity index 100% rename from keras/distribute/distributed_file_utils.py rename to tf_keras/distribute/distributed_file_utils.py diff --git a/keras/distribute/distributed_file_utils_test.py b/tf_keras/distribute/distributed_file_utils_test.py similarity index 99% rename from keras/distribute/distributed_file_utils_test.py rename to tf_keras/distribute/distributed_file_utils_test.py index 0260b45c1..0b8d43acc 100644 --- a/keras/distribute/distributed_file_utils_test.py +++ b/tf_keras/distribute/distributed_file_utils_test.py @@ -18,7 +18,7 @@ import tensorflow.compat.v2 as tf -from keras.distribute import distributed_file_utils +from tf_keras.distribute import distributed_file_utils class DistributedFileUtilsTest(tf.test.TestCase): diff --git a/keras/distribute/distributed_training_utils.py b/tf_keras/distribute/distributed_training_utils.py similarity index 99% rename from keras/distribute/distributed_training_utils.py rename to tf_keras/distribute/distributed_training_utils.py index 61edf4f51..bf7508f81 100644 --- a/keras/distribute/distributed_training_utils.py +++ b/tf_keras/distribute/distributed_training_utils.py @@ -19,7 +19,7 @@ import tensorflow.compat.v2 as tf from absl import flags -from keras import backend +from tf_keras import backend FLAGS = flags.FLAGS diff --git a/keras/distribute/distributed_training_utils_test.py b/tf_keras/distribute/distributed_training_utils_test.py similarity index 90% rename from keras/distribute/distributed_training_utils_test.py rename to tf_keras/distribute/distributed_training_utils_test.py index 690cade75..45b654d71 100644 --- a/keras/distribute/distributed_training_utils_test.py +++ b/tf_keras/distribute/distributed_training_utils_test.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -from keras import callbacks -from keras.distribute import distributed_training_utils_v1 -from keras.optimizers.legacy import adam +from tf_keras import callbacks +from tf_keras.distribute import distributed_training_utils_v1 +from tf_keras.optimizers.legacy import adam class DistributedTrainingUtilsTest(tf.test.TestCase): @@ -45,7 +45,7 @@ def test_validate_callbacks_predefined_callbacks(self): for callback in unsupported_predefined_callbacks: with self.assertRaisesRegex( - ValueError, "You must specify a Keras Optimizer V2" + ValueError, "You must specify a TF-Keras Optimizer V2" ): distributed_training_utils_v1.validate_callbacks( [callback], tf.compat.v1.train.AdamOptimizer() diff --git a/keras/distribute/distributed_training_utils_v1.py b/tf_keras/distribute/distributed_training_utils_v1.py similarity index 98% rename from keras/distribute/distributed_training_utils_v1.py rename to tf_keras/distribute/distributed_training_utils_v1.py index 8b19235f4..0c2d026db 100644 --- a/keras/distribute/distributed_training_utils_v1.py +++ b/tf_keras/distribute/distributed_training_utils_v1.py @@ -19,16 +19,16 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import callbacks -from keras import metrics as metrics_module -from keras import optimizers -from keras.distribute import distribute_coordinator_utils as dc -from keras.distribute import distributed_training_utils as dist_utils -from keras.engine import training_utils_v1 -from keras.optimizers.legacy import optimizer_v2 -from keras.utils import tf_contextlib -from keras.utils.mode_keys import ModeKeys +from tf_keras import backend +from tf_keras import callbacks +from tf_keras import metrics as metrics_module +from tf_keras import optimizers +from tf_keras.distribute import distribute_coordinator_utils as dc +from tf_keras.distribute import distributed_training_utils as dist_utils +from tf_keras.engine import training_utils_v1 +from tf_keras.optimizers.legacy import optimizer_v2 +from tf_keras.utils import tf_contextlib +from tf_keras.utils.mode_keys import ModeKeys # isort: off from tensorflow.python.platform import tf_logging as logging @@ -267,7 +267,7 @@ def validate_callbacks(input_callbacks, optimizer): if not isinstance(optimizer, optimizer_v2.OptimizerV2): raise ValueError( - "You must specify a Keras Optimizer V2 when using " + "You must specify a TF-Keras Optimizer V2 when using " "%s callback with DistributionStrategy." % callback ) @@ -706,7 +706,7 @@ def is_distributing_by_cloning(model): We are going to distribute the model by cloning in graph mode. Args: - model: Keras model to distribute. + model: TF-Keras model to distribute. Returns: True if the `model` is going to be distributed using cloning and False @@ -739,7 +739,7 @@ def _custom_compile_for_predict(model): def _build_network_on_replica(model, mode, inputs=None, targets=None): """Build an updated model on replicas. - We create a new Keras model while sharing the variables from the old graph. + We create a new TF-Keras model while sharing the variables from the old graph. Building a new sub-graph is required since the original keras model creates placeholders for the input and the output that are not accessible till we call iterator.get_next() inside the step_fn for `fit`/`evaluate`/`predict`. @@ -762,8 +762,8 @@ def _build_network_on_replica(model, mode, inputs=None, targets=None): A new model with shared layers with the old model. """ # Need to do imports here since we run into a circular dependency error. - from keras import models - from keras.engine import sequential + from tf_keras import models + from tf_keras.engine import sequential # We rely on the internal methods to avoid having share_weights weights in # the public API. @@ -827,7 +827,7 @@ def _clone_and_build_model(model, mode, inputs=None, targets=None): """Clone and build the given keras_model.""" # We need to set the import here since we run into a circular dependency # error. - from keras import models + from tf_keras import models cloned_model = models.clone_model(model, input_tensors=inputs) @@ -1100,7 +1100,7 @@ def _per_replica_function(model): with_loss_tensor=(mode != ModeKeys.PREDICT), ) - # Finally, a joint Keras function is created; this one will be created + # Finally, a joint TF-Keras function is created; this one will be created # in a separate FuncGraph. return backend.function( all_inputs, @@ -1199,7 +1199,7 @@ def filter_distributed_callbacks(callbacks_list, model): Args: callbacks_list: A list of `Callback` instances. - model: Keras model instance. + model: TF-Keras model instance. Returns: The list of `Callback` instances that should be run on this worker. @@ -1207,7 +1207,7 @@ def filter_distributed_callbacks(callbacks_list, model): if not model._in_multi_worker_mode(): raise ValueError( - "filter_distributed_callbacks() should only be called when Keras " + "filter_distributed_callbacks() should only be called when TF-Keras " "is in multi worker mode." ) diff --git a/keras/distribute/keras_correctness_test_base.py b/tf_keras/distribute/keras_correctness_test_base.py similarity index 97% rename from keras/distribute/keras_correctness_test_base.py rename to tf_keras/distribute/keras_correctness_test_base.py index 1e5501654..e0806a582 100644 --- a/keras/distribute/keras_correctness_test_base.py +++ b/tf_keras/distribute/keras_correctness_test_base.py @@ -20,15 +20,15 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.distribute import distributed_training_utils -from keras.distribute.strategy_combinations import all_strategies -from keras.distribute.strategy_combinations import ( +import tf_keras as keras +from tf_keras.distribute import distributed_training_utils +from tf_keras.distribute.strategy_combinations import all_strategies +from tf_keras.distribute.strategy_combinations import ( multi_worker_mirrored_strategies, ) -from keras.distribute.strategy_combinations import strategies_minus_tpu -from keras.mixed_precision import policy -from keras.utils import data_utils +from tf_keras.distribute.strategy_combinations import strategies_minus_tpu +from tf_keras.mixed_precision import policy +from tf_keras.utils import data_utils _RANDOM_SEED = 1337 _EVAL_STEPS = 20 @@ -206,7 +206,7 @@ def get_correctness_test_inputs( x_predict, training_epochs, ): - """Generates the inputs for correctness check when enable Keras with DS.""" + """Generates the inputs for correctness check when enable TF-Keras with DS.""" global_batch_size = _GLOBAL_BATCH_SIZE batch_size = get_batch_size(global_batch_size, with_distribution) @@ -340,9 +340,9 @@ def compare_results( # We relax the tolerance a lot in the partial last batch case as # 1. the examples in uneven batches may have different weights when # applying the gradients in the distributed case. - # 2. TF Keras and TF Keras DS have different ways to handle the case + # 2. TF TF-Keras and TF TF-Keras DS have different ways to handle the case # when training with epochs > 1 with numpy inputs. In TF Keras, - # every epoch may have a partial batch. While in TF Keras DS, as we + # every epoch may have a partial batch. While in TF TF-Keras DS, as we # convert numpy inputs into dataset, it will do a repeat() first # and calculate steps_per_epoch, so it will at most have one # partial batch. This makes the 1-CPU result even different. @@ -429,7 +429,7 @@ def on_batch_begin(self, batch, logs=None): class TestDistributionStrategyCorrectnessBase( tf.test.TestCase, parameterized.TestCase ): - """Model agnostic testing infra to test correctness of Keras models.""" + """Model agnostic testing infra to test correctness of TF-Keras models.""" def set_up_test_config( self, use_numpy=False, use_validation_data=False, with_batch_norm=None @@ -671,7 +671,7 @@ def run_dynamic_lr_test(self, distribution): class TestDistributionStrategyEmbeddingModelCorrectnessBase( TestDistributionStrategyCorrectnessBase ): - """Base class to test correctness of Keras models with embedding layers.""" + """Base class to test correctness of TF-Keras models with embedding layers.""" def get_data( self, diff --git a/keras/distribute/keras_dnn_correctness_test.py b/tf_keras/distribute/keras_dnn_correctness_test.py similarity index 97% rename from keras/distribute/keras_dnn_correctness_test.py rename to tf_keras/distribute/keras_dnn_correctness_test.py index 9577957a2..081069ddc 100644 --- a/keras/distribute/keras_dnn_correctness_test.py +++ b/tf_keras/distribute/keras_dnn_correctness_test.py @@ -17,12 +17,12 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras import backend -from keras.distribute import keras_correctness_test_base -from keras.distribute import strategy_combinations -from keras.optimizers.legacy import gradient_descent as gradient_descent_keras -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras import backend +from tf_keras.distribute import keras_correctness_test_base +from tf_keras.distribute import strategy_combinations +from tf_keras.optimizers.legacy import gradient_descent as gradient_descent_keras +from tf_keras.testing_infra import test_utils def all_strategy_combinations_with_eager_and_graph_modes(): diff --git a/keras/distribute/keras_embedding_model_correctness_test.py b/tf_keras/distribute/keras_embedding_model_correctness_test.py similarity index 97% rename from keras/distribute/keras_embedding_model_correctness_test.py rename to tf_keras/distribute/keras_embedding_model_correctness_test.py index f126c4160..33482b14b 100644 --- a/keras/distribute/keras_embedding_model_correctness_test.py +++ b/tf_keras/distribute/keras_embedding_model_correctness_test.py @@ -17,9 +17,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.distribute import keras_correctness_test_base -from keras.optimizers.legacy import gradient_descent as gradient_descent_keras +import tf_keras as keras +from tf_keras.distribute import keras_correctness_test_base +from tf_keras.optimizers.legacy import gradient_descent as gradient_descent_keras class DistributionStrategyEmbeddingModelCorrectnessTest( diff --git a/keras/distribute/keras_image_model_correctness_test.py b/tf_keras/distribute/keras_image_model_correctness_test.py similarity index 97% rename from keras/distribute/keras_image_model_correctness_test.py rename to tf_keras/distribute/keras_image_model_correctness_test.py index 687c180aa..995e9eb43 100644 --- a/keras/distribute/keras_image_model_correctness_test.py +++ b/tf_keras/distribute/keras_image_model_correctness_test.py @@ -17,10 +17,10 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.distribute import keras_correctness_test_base -from keras.optimizers.legacy import gradient_descent -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.distribute import keras_correctness_test_base +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.testing_infra import test_utils @test_utils.run_all_without_tensor_float_32( diff --git a/keras/distribute/keras_metrics_test.py b/tf_keras/distribute/keras_metrics_test.py similarity index 99% rename from keras/distribute/keras_metrics_test.py rename to tf_keras/distribute/keras_metrics_test.py index a0f79e418..24502c77f 100644 --- a/keras/distribute/keras_metrics_test.py +++ b/tf_keras/distribute/keras_metrics_test.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras metrics.""" +"""Tests for TF-Keras metrics.""" import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import metrics -from keras.engine import base_layer +from tf_keras import metrics +from tf_keras.engine import base_layer combinations = tf.__internal__.distribute.combinations diff --git a/keras/distribute/keras_models_test.py b/tf_keras/distribute/keras_models_test.py similarity index 92% rename from keras/distribute/keras_models_test.py rename to tf_keras/distribute/keras_models_test.py index 4cc9e9c35..c06795b4a 100644 --- a/keras/distribute/keras_models_test.py +++ b/tf_keras/distribute/keras_models_test.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras high level APIs, e.g. fit, evaluate and predict.""" +"""Tests for TF-Keras high level APIs, e.g. fit, evaluate and predict.""" import numpy as np import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.distribute.strategy_combinations import all_strategies +import tf_keras as keras +from tf_keras.distribute.strategy_combinations import all_strategies class KerasModelsTest(tf.test.TestCase, parameterized.TestCase): diff --git a/keras/distribute/keras_optimizer_v2_test.py b/tf_keras/distribute/keras_optimizer_v2_test.py similarity index 97% rename from keras/distribute/keras_optimizer_v2_test.py rename to tf_keras/distribute/keras_optimizer_v2_test.py index 1b4c6150a..fd450d21f 100644 --- a/keras/distribute/keras_optimizer_v2_test.py +++ b/tf_keras/distribute/keras_optimizer_v2_test.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.optimizers.legacy import adam -from keras.optimizers.legacy import gradient_descent +import tf_keras as keras +from tf_keras.optimizers.legacy import adam +from tf_keras.optimizers.legacy import gradient_descent def get_model(): diff --git a/keras/distribute/keras_premade_models_test.py b/tf_keras/distribute/keras_premade_models_test.py similarity index 95% rename from keras/distribute/keras_premade_models_test.py rename to tf_keras/distribute/keras_premade_models_test.py index e4badc570..5c2439683 100644 --- a/keras/distribute/keras_premade_models_test.py +++ b/tf_keras/distribute/keras_premade_models_test.py @@ -18,13 +18,13 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.engine import sequential -from keras.layers import core -from keras.optimizers.legacy import adagrad -from keras.optimizers.legacy import gradient_descent -from keras.premade_models import linear -from keras.premade_models import wide_deep -from keras.utils import dataset_creator +from tf_keras.engine import sequential +from tf_keras.layers import core +from tf_keras.optimizers.legacy import adagrad +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.premade_models import linear +from tf_keras.premade_models import wide_deep +from tf_keras.utils import dataset_creator def strategy_combinations_eager_data_fn(): diff --git a/keras/distribute/keras_rnn_model_correctness_test.py b/tf_keras/distribute/keras_rnn_model_correctness_test.py similarity index 92% rename from keras/distribute/keras_rnn_model_correctness_test.py rename to tf_keras/distribute/keras_rnn_model_correctness_test.py index 74bf17077..113a7da08 100644 --- a/keras/distribute/keras_rnn_model_correctness_test.py +++ b/tf_keras/distribute/keras_rnn_model_correctness_test.py @@ -17,15 +17,15 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.distribute import keras_correctness_test_base -from keras.layers.rnn import gru -from keras.layers.rnn import gru_v1 -from keras.layers.rnn import lstm -from keras.layers.rnn import lstm_v1 -from keras.mixed_precision import policy -from keras.optimizers.legacy import gradient_descent as gradient_descent_keras -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.distribute import keras_correctness_test_base +from tf_keras.layers.rnn import gru +from tf_keras.layers.rnn import gru_v1 +from tf_keras.layers.rnn import lstm +from tf_keras.layers.rnn import lstm_v1 +from tf_keras.mixed_precision import policy +from tf_keras.optimizers.legacy import gradient_descent as gradient_descent_keras +from tf_keras.testing_infra import test_utils class _DistributionStrategyRnnModelCorrectnessTest( diff --git a/keras/distribute/keras_save_load_test.py b/tf_keras/distribute/keras_save_load_test.py similarity index 95% rename from keras/distribute/keras_save_load_test.py rename to tf_keras/distribute/keras_save_load_test.py index b72be7171..552eb46a8 100644 --- a/keras/distribute/keras_save_load_test.py +++ b/tf_keras/distribute/keras_save_load_test.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -from keras.distribute import saved_model_test_base as test_base -from keras.saving.legacy import save -from keras.testing_infra import test_utils +from tf_keras.distribute import saved_model_test_base as test_base +from tf_keras.saving.legacy import save +from tf_keras.testing_infra import test_utils @test_utils.run_all_without_tensor_float_32( diff --git a/keras/distribute/keras_stateful_lstm_model_correctness_test.py b/tf_keras/distribute/keras_stateful_lstm_model_correctness_test.py similarity index 95% rename from keras/distribute/keras_stateful_lstm_model_correctness_test.py rename to tf_keras/distribute/keras_stateful_lstm_model_correctness_test.py index 631643c64..6d4a42869 100644 --- a/keras/distribute/keras_stateful_lstm_model_correctness_test.py +++ b/tf_keras/distribute/keras_stateful_lstm_model_correctness_test.py @@ -17,9 +17,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.distribute import keras_correctness_test_base -from keras.optimizers.legacy import gradient_descent as gradient_descent_keras +import tf_keras as keras +from tf_keras.distribute import keras_correctness_test_base +from tf_keras.optimizers.legacy import gradient_descent as gradient_descent_keras def strategies_for_stateful_embedding_model(): diff --git a/keras/distribute/keras_utils_test.py b/tf_keras/distribute/keras_utils_test.py similarity index 99% rename from keras/distribute/keras_utils_test.py rename to tf_keras/distribute/keras_utils_test.py index 8925801ea..5927fae47 100644 --- a/keras/distribute/keras_utils_test.py +++ b/tf_keras/distribute/keras_utils_test.py @@ -22,11 +22,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import losses -from keras.distribute import distribute_strategy_test as keras_test_lib -from keras.distribute import distributed_training_utils_v1 -from keras.distribute import optimizer_combinations +import tf_keras as keras +from tf_keras import losses +from tf_keras.distribute import distribute_strategy_test as keras_test_lib +from tf_keras.distribute import distributed_training_utils_v1 +from tf_keras.distribute import optimizer_combinations class Counter(keras.callbacks.Callback): diff --git a/keras/distribute/minimize_loss_test.py b/tf_keras/distribute/minimize_loss_test.py similarity index 99% rename from keras/distribute/minimize_loss_test.py rename to tf_keras/distribute/minimize_loss_test.py index 14168b003..cf8f5c075 100644 --- a/keras/distribute/minimize_loss_test.py +++ b/tf_keras/distribute/minimize_loss_test.py @@ -19,11 +19,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.distribute import optimizer_combinations -from keras.distribute.test_example import batchnorm_example -from keras.distribute.test_example import minimize_loss_example -from keras.layers import core -from keras.optimizers.legacy import optimizer_v2 +from tf_keras.distribute import optimizer_combinations +from tf_keras.distribute.test_example import batchnorm_example +from tf_keras.distribute.test_example import minimize_loss_example +from tf_keras.layers import core +from tf_keras.optimizers.legacy import optimizer_v2 VAR_MAP_V1 = { "GradientDescent": ("dense/kernel", "dense/bias"), diff --git a/keras/distribute/mirrored_strategy_test.py b/tf_keras/distribute/mirrored_strategy_test.py similarity index 96% rename from keras/distribute/mirrored_strategy_test.py rename to tf_keras/distribute/mirrored_strategy_test.py index 2f482f5cc..1469936d1 100644 --- a/keras/distribute/mirrored_strategy_test.py +++ b/tf_keras/distribute/mirrored_strategy_test.py @@ -18,11 +18,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.engine import training as keras_training -from keras.layers import core as keras_core -from keras.optimizers.legacy import rmsprop -from keras.utils import kpl_test_utils +import tf_keras as keras +from tf_keras.engine import training as keras_training +from tf_keras.layers import core as keras_core +from tf_keras.optimizers.legacy import rmsprop +from tf_keras.utils import kpl_test_utils # isort: off from tensorflow.python.eager import backprop diff --git a/keras/distribute/mirrored_variable_test.py b/tf_keras/distribute/mirrored_variable_test.py similarity index 97% rename from keras/distribute/mirrored_variable_test.py rename to tf_keras/distribute/mirrored_variable_test.py index fc7cdb566..d11b3efe6 100644 --- a/keras/distribute/mirrored_variable_test.py +++ b/tf_keras/distribute/mirrored_variable_test.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras.distribute import distributed_training_utils -from keras.layers import core +from tf_keras.distribute import distributed_training_utils +from tf_keras.layers import core def _mimic_two_cpus(): diff --git a/keras/distribute/model_checkpoint_test.py b/tf_keras/distribute/model_checkpoint_test.py similarity index 96% rename from keras/distribute/model_checkpoint_test.py rename to tf_keras/distribute/model_checkpoint_test.py index a2d75cc5d..3d87de4ee 100644 --- a/keras/distribute/model_checkpoint_test.py +++ b/tf_keras/distribute/model_checkpoint_test.py @@ -20,8 +20,8 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import callbacks -from keras.distribute import multi_worker_testing_utils +from tf_keras import callbacks +from tf_keras.distribute import multi_worker_testing_utils class ModelCheckpointTest(tf.test.TestCase, parameterized.TestCase): diff --git a/keras/distribute/model_collection_base.py b/tf_keras/distribute/model_collection_base.py similarity index 100% rename from keras/distribute/model_collection_base.py rename to tf_keras/distribute/model_collection_base.py diff --git a/keras/distribute/model_combinations.py b/tf_keras/distribute/model_combinations.py similarity index 96% rename from keras/distribute/model_combinations.py rename to tf_keras/distribute/model_combinations.py index 0349cad55..7ff5f05cb 100644 --- a/keras/distribute/model_combinations.py +++ b/tf_keras/distribute/model_combinations.py @@ -16,7 +16,7 @@ import tensorflow.compat.v2 as tf -from keras.distribute import simple_models +from tf_keras.distribute import simple_models simple_functional_model = tf.__internal__.test.combinations.NamedObject( "SimpleFunctionalModel", simple_models.SimpleFunctionalModel() diff --git a/keras/distribute/multi_worker_callback_tf2_test.py b/tf_keras/distribute/multi_worker_callback_tf2_test.py similarity index 98% rename from keras/distribute/multi_worker_callback_tf2_test.py rename to tf_keras/distribute/multi_worker_callback_tf2_test.py index 69043d6bd..3761cafe7 100644 --- a/keras/distribute/multi_worker_callback_tf2_test.py +++ b/tf_keras/distribute/multi_worker_callback_tf2_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras callbacks in multi-worker training with TF2.""" +"""Tests for TF-Keras callbacks in multi-worker training with TF2.""" import json import os @@ -20,9 +20,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import callbacks -from keras.distribute import distributed_file_utils -from keras.distribute import multi_worker_testing_utils +from tf_keras import callbacks +from tf_keras.distribute import distributed_file_utils +from tf_keras.distribute import multi_worker_testing_utils def checkpoint_exists(filepath): @@ -35,9 +35,9 @@ def checkpoint_exists(filepath): def _model_setup(test_obj, file_format): - """Set up a MNIST Keras model for testing purposes. + """Set up a MNIST TF-Keras model for testing purposes. - This function builds a MNIST Keras model and returns relevant information + This function builds a MNIST TF-Keras model and returns relevant information for testing. Args: diff --git a/keras/distribute/multi_worker_test.py b/tf_keras/distribute/multi_worker_test.py similarity index 97% rename from keras/distribute/multi_worker_test.py rename to tf_keras/distribute/multi_worker_test.py index 243b6b547..0239b56a1 100644 --- a/keras/distribute/multi_worker_test.py +++ b/tf_keras/distribute/multi_worker_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Test multi-worker Keras.""" +"""Test multi-worker TF-Keras.""" import collections import copy @@ -25,15 +25,15 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import backend -from keras import callbacks -from keras import metrics as metrics_module -from keras import models -from keras.distribute import multi_worker_testing_utils -from keras.optimizers import optimizer_v1 -from keras.optimizers.legacy import rmsprop -from keras.utils import kpl_test_utils +import tf_keras as keras +from tf_keras import backend +from tf_keras import callbacks +from tf_keras import metrics as metrics_module +from tf_keras import models +from tf_keras.distribute import multi_worker_testing_utils +from tf_keras.optimizers import optimizer_v1 +from tf_keras.optimizers.legacy import rmsprop +from tf_keras.utils import kpl_test_utils def _clone_and_build_model(model, strategy): diff --git a/keras/distribute/multi_worker_testing_utils.py b/tf_keras/distribute/multi_worker_testing_utils.py similarity index 98% rename from keras/distribute/multi_worker_testing_utils.py rename to tf_keras/distribute/multi_worker_testing_utils.py index c0fd9d19d..a40220043 100644 --- a/keras/distribute/multi_worker_testing_utils.py +++ b/tf_keras/distribute/multi_worker_testing_utils.py @@ -12,15 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Utilities for testing multi-worker distribution strategies with Keras.""" +"""Utilities for testing multi-worker distribution strategies with TF-Keras.""" import threading import unittest import tensorflow.compat.v2 as tf -import keras -from keras.optimizers.legacy import gradient_descent +import tf_keras as keras +from tf_keras.optimizers.legacy import gradient_descent # isort: off from tensorflow.python.distribute.cluster_resolver import ( diff --git a/keras/distribute/optimizer_combinations.py b/tf_keras/distribute/optimizer_combinations.py similarity index 90% rename from keras/distribute/optimizer_combinations.py rename to tf_keras/distribute/optimizer_combinations.py index 9df667080..0f3ed2f19 100644 --- a/keras/distribute/optimizer_combinations.py +++ b/tf_keras/distribute/optimizer_combinations.py @@ -16,17 +16,17 @@ import tensorflow.compat.v2 as tf -from keras.optimizers import adam as adam_experimental -from keras.optimizers.legacy import adadelta as adadelta_keras_v2 -from keras.optimizers.legacy import adagrad as adagrad_keras_v2 -from keras.optimizers.legacy import adam as adam_keras_v2 -from keras.optimizers.legacy import adamax as adamax_keras_v2 -from keras.optimizers.legacy import ftrl as ftrl_keras_v2 -from keras.optimizers.legacy import ( +from tf_keras.optimizers import adam as adam_experimental +from tf_keras.optimizers.legacy import adadelta as adadelta_keras_v2 +from tf_keras.optimizers.legacy import adagrad as adagrad_keras_v2 +from tf_keras.optimizers.legacy import adam as adam_keras_v2 +from tf_keras.optimizers.legacy import adamax as adamax_keras_v2 +from tf_keras.optimizers.legacy import ftrl as ftrl_keras_v2 +from tf_keras.optimizers.legacy import ( gradient_descent as gradient_descent_keras_v2, ) -from keras.optimizers.legacy import nadam as nadam_keras_v2 -from keras.optimizers.legacy import rmsprop as rmsprop_keras_v2 +from tf_keras.optimizers.legacy import nadam as nadam_keras_v2 +from tf_keras.optimizers.legacy import rmsprop as rmsprop_keras_v2 gradient_descent_optimizer_v1_fn = ( tf.__internal__.test.combinations.NamedObject( diff --git a/keras/distribute/parameter_server_evaluation_test.py b/tf_keras/distribute/parameter_server_evaluation_test.py similarity index 96% rename from keras/distribute/parameter_server_evaluation_test.py rename to tf_keras/distribute/parameter_server_evaluation_test.py index 647d35d85..6f9bc618a 100644 --- a/keras/distribute/parameter_server_evaluation_test.py +++ b/tf_keras/distribute/parameter_server_evaluation_test.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for evaluation using Keras model and ParameterServerStrategy.""" +"""Tests for evaluation using TF-Keras model and ParameterServerStrategy.""" import time import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.distribute import ( @@ -31,7 +31,7 @@ from tensorflow.python.ops import resource_variable_ops -# TODO(yuefengz): move the following implementation to Keras core. +# TODO(yuefengz): move the following implementation to TF-Keras core. class MeanMetricSpec(tf.TypeSpec): def __init__(self, config, weights): self._config = config diff --git a/keras/distribute/parameter_server_exact_evaluation_test.py b/tf_keras/distribute/parameter_server_exact_evaluation_test.py similarity index 98% rename from keras/distribute/parameter_server_exact_evaluation_test.py rename to tf_keras/distribute/parameter_server_exact_evaluation_test.py index 097fbdffd..046c5ad92 100644 --- a/keras/distribute/parameter_server_exact_evaluation_test.py +++ b/tf_keras/distribute/parameter_server_exact_evaluation_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for evaluation using Keras model and ParameterServerStrategy.""" +"""Tests for evaluation using TF-Keras model and ParameterServerStrategy.""" import threading import time @@ -21,11 +21,11 @@ from absl.testing import parameterized from tensorflow.python.platform import tf_logging as logging -import keras -from keras.metrics import base_metric -from keras.testing_infra import test_utils -from keras.utils import dataset_creator -from keras.utils import tf_utils +import tf_keras as keras +from tf_keras.metrics import base_metric +from tf_keras.testing_infra import test_utils +from tf_keras.utils import dataset_creator +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.distribute import ( diff --git a/keras/distribute/saved_model_mixed_api_test.py b/tf_keras/distribute/saved_model_mixed_api_test.py similarity index 95% rename from keras/distribute/saved_model_mixed_api_test.py rename to tf_keras/distribute/saved_model_mixed_api_test.py index 0aaeed7c1..6b10a33c1 100644 --- a/keras/distribute/saved_model_mixed_api_test.py +++ b/tf_keras/distribute/saved_model_mixed_api_test.py @@ -22,9 +22,9 @@ import tensorflow.compat.v2 as tf -from keras.distribute import saved_model_test_base as test_base -from keras.saving.legacy import save -from keras.testing_infra import test_utils +from tf_keras.distribute import saved_model_test_base as test_base +from tf_keras.saving.legacy import save +from tf_keras.testing_infra import test_utils _DEFAULT_FUNCTION_KEY = "serving_default" diff --git a/keras/distribute/saved_model_save_load_test.py b/tf_keras/distribute/saved_model_save_load_test.py similarity index 98% rename from keras/distribute/saved_model_save_load_test.py rename to tf_keras/distribute/saved_model_save_load_test.py index 2ca75d238..2306ab0ca 100644 --- a/keras/distribute/saved_model_save_load_test.py +++ b/tf_keras/distribute/saved_model_save_load_test.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf -from keras.distribute import model_combinations -from keras.distribute import saved_model_test_base as test_base -from keras.testing_infra import test_utils +from tf_keras.distribute import model_combinations +from tf_keras.distribute import saved_model_test_base as test_base +from tf_keras.testing_infra import test_utils @test_utils.run_v2_only diff --git a/keras/distribute/saved_model_test_base.py b/tf_keras/distribute/saved_model_test_base.py similarity index 99% rename from keras/distribute/saved_model_test_base.py rename to tf_keras/distribute/saved_model_test_base.py index 09e8e5aff..f499168cc 100644 --- a/keras/distribute/saved_model_test_base.py +++ b/tf_keras/distribute/saved_model_test_base.py @@ -20,7 +20,7 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.distribute import model_combinations +from tf_keras.distribute import model_combinations _RANDOM_SEED = 1337 _DEFAULT_FUNCTION_KEY = "serving_default" diff --git a/keras/distribute/sharded_variable_test.py b/tf_keras/distribute/sharded_variable_test.py similarity index 98% rename from keras/distribute/sharded_variable_test.py rename to tf_keras/distribute/sharded_variable_test.py index acd1e6fd3..c66a14a9b 100644 --- a/keras/distribute/sharded_variable_test.py +++ b/tf_keras/distribute/sharded_variable_test.py @@ -12,16 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for ClusterCoordinator and Keras models.""" +"""Tests for ClusterCoordinator and TF-Keras models.""" import numpy as np import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.distribute import multi_worker_testing_utils -from keras.distribute import strategy_combinations -from keras.engine import base_layer +import tf_keras as keras +from tf_keras.distribute import multi_worker_testing_utils +from tf_keras.distribute import strategy_combinations +from tf_keras.engine import base_layer class ShardedVariableTest(tf.test.TestCase, parameterized.TestCase): diff --git a/keras/distribute/simple_models.py b/tf_keras/distribute/simple_models.py similarity index 96% rename from keras/distribute/simple_models.py rename to tf_keras/distribute/simple_models.py index 0b5384e12..04364ac47 100644 --- a/keras/distribute/simple_models.py +++ b/tf_keras/distribute/simple_models.py @@ -17,9 +17,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.distribute import model_collection_base -from keras.optimizers.legacy import gradient_descent +import tf_keras as keras +from tf_keras.distribute import model_collection_base +from tf_keras.optimizers.legacy import gradient_descent _BATCH_SIZE = 10 diff --git a/keras/distribute/strategy_combinations.py b/tf_keras/distribute/strategy_combinations.py similarity index 100% rename from keras/distribute/strategy_combinations.py rename to tf_keras/distribute/strategy_combinations.py diff --git a/keras/distribute/test_example.py b/tf_keras/distribute/test_example.py similarity index 95% rename from keras/distribute/test_example.py rename to tf_keras/distribute/test_example.py index aa216592b..5ff0eb4b8 100644 --- a/keras/distribute/test_example.py +++ b/tf_keras/distribute/test_example.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -from keras.legacy_tf_layers import core -from keras.legacy_tf_layers import normalization -from keras.optimizers.legacy import optimizer_v2 +from tf_keras.legacy_tf_layers import core +from tf_keras.legacy_tf_layers import normalization +from tf_keras.optimizers.legacy import optimizer_v2 def minimize_loss_example(optimizer, use_bias=False, use_callable_loss=True): diff --git a/keras/distribute/tpu_strategy_test_utils.py b/tf_keras/distribute/tpu_strategy_test_utils.py similarity index 100% rename from keras/distribute/tpu_strategy_test_utils.py rename to tf_keras/distribute/tpu_strategy_test_utils.py diff --git a/keras/distribute/worker_training_state.py b/tf_keras/distribute/worker_training_state.py similarity index 98% rename from keras/distribute/worker_training_state.py rename to tf_keras/distribute/worker_training_state.py index 335feedc8..a2c87fc31 100644 --- a/keras/distribute/worker_training_state.py +++ b/tf_keras/distribute/worker_training_state.py @@ -18,12 +18,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.distribute import distributed_file_utils -from keras.utils import mode_keys +from tf_keras import backend +from tf_keras.distribute import distributed_file_utils +from tf_keras.utils import mode_keys # isort: off -from keras.distribute.distributed_file_utils import ( +from tf_keras.distribute.distributed_file_utils import ( support_on_demand_checkpoint_callback, ) # noqa: E501 diff --git a/keras/distribute/worker_training_state_test.py b/tf_keras/distribute/worker_training_state_test.py similarity index 95% rename from keras/distribute/worker_training_state_test.py rename to tf_keras/distribute/worker_training_state_test.py index c2d3cde46..da9795930 100644 --- a/keras/distribute/worker_training_state_test.py +++ b/tf_keras/distribute/worker_training_state_test.py @@ -20,8 +20,8 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import callbacks -from keras.distribute import multi_worker_testing_utils +from tf_keras import callbacks +from tf_keras.distribute import multi_worker_testing_utils class WorkerTrainingStateTest(tf.test.TestCase, parameterized.TestCase): diff --git a/keras/dtensor/BUILD b/tf_keras/dtensor/BUILD similarity index 72% rename from keras/dtensor/BUILD rename to tf_keras/dtensor/BUILD index 79716c1a3..f287c0c22 100644 --- a/keras/dtensor/BUILD +++ b/tf_keras/dtensor/BUILD @@ -1,9 +1,9 @@ -# This package contains all the DTensor related Keras components. +# This package contains all the DTensor related TF-Keras components. # Since DTensor is not a public API yet, all the DTensor related change # can't be exposed to public yet. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") # copybara:uncomment_begin(google-only) # load( @@ -13,12 +13,12 @@ load("@org_keras//keras:keras.bzl", "tf_py_test") # copybara:uncomment_end package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", "//learning/brain/distribute/experimental/auto_distribute:__pkg__", "//learning/brain/distribute/python:__subpackages__", "//learning/brain/experimental/dtensor/models:__subpackages__", + "//tf_keras:friends", ], licenses = ["notice"], ) @@ -40,9 +40,9 @@ tf_py_test( ":test_util", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/initializers", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/initializers", + "//tf_keras/utils:tf_utils", ], ) @@ -56,8 +56,8 @@ tf_py_test( ":test_util", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/layers", - "//keras/utils:tf_utils", + "//tf_keras/layers", + "//tf_keras/utils:tf_utils", ], ) @@ -68,7 +68,7 @@ py_library( ":dtensor", ":lazy_variable", ":utils", - "//keras/engine:base_layer", + "//tf_keras/engine:base_layer", ], ) @@ -82,10 +82,10 @@ tf_py_test( ":test_util", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/layers", - "//keras/models", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/layers", + "//tf_keras/models", + "//tf_keras/utils:tf_utils", ], ) @@ -97,11 +97,11 @@ py_library( ":layout_map", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:losses", - "//keras/datasets", - "//keras/layers", - "//keras/models", - "//keras/utils:np_utils", + "//tf_keras:losses", + "//tf_keras/datasets", + "//tf_keras/layers", + "//tf_keras/models", + "//tf_keras/utils:np_utils", ], ) @@ -112,11 +112,11 @@ tf_py_test( deps = [ ":dtensor", ":test_util", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/metrics", - "//keras/utils:tf_utils", + "//tf_keras/metrics", + "//tf_keras/utils:tf_utils", ], ) @@ -137,11 +137,11 @@ tf_py_test( # ":integration_test_utils", # ":layout_map", # ":test_util", -# "//keras:backend", -# "//keras/optimizers", -# "//keras/utils:tf_utils", # "//:expect_numpy_installed", # "//:expect_tensorflow_installed", +# "//tf_keras:backend", +# "//tf_keras/optimizers", +# "//tf_keras/utils:tf_utils", # ], # ) # copybara:uncomment_end @@ -155,10 +155,10 @@ tf_py_test( ":test_util", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:losses", - "//keras/layers", - "//keras/models", - "//keras/optimizers", + "//tf_keras:losses", + "//tf_keras/layers", + "//tf_keras/models", + "//tf_keras/optimizers", ], ) @@ -186,10 +186,10 @@ tf_py_test( ":dtensor", ":test_util", ":utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/layers", + "//tf_keras/layers", ], ) @@ -197,7 +197,7 @@ py_library( name = "test_util", srcs = ["test_util.py"], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", ], @@ -210,11 +210,11 @@ tf_py_test( ":dtensor", ":layout_map", ":test_util", - "//keras", - "//keras:backend", - "//keras/layers", - "//keras/models", - "//keras/utils:tf_utils", + "//tf_keras", + "//tf_keras:backend", + "//tf_keras/layers", + "//tf_keras/models", + "//tf_keras/utils:tf_utils", ], ) @@ -231,13 +231,13 @@ tf_py_test( # deps = [ # ":integration_test_utils", # ":test_util", -# "//:expect_absl_installed", -# "//keras:backend", -# "//keras/mixed_precision:mixed_precision_experimental", -# "//keras/optimizers", -# "//keras/utils:tf_utils", +# "//:expect_absl_installed", # absl/testing:parameterized # "//:expect_numpy_installed", # "//:expect_tensorflow_installed", +# "//tf_keras:backend", +# "//tf_keras/mixed_precision:mixed_precision_experimental", +# "//tf_keras/optimizers", +# "//tf_keras/utils:tf_utils", # "//third_party/tensorflow/dtensor/python/tests:test_util", # "//third_party/tensorflow/python/distribute/experimental:mirrored_strategy", # ], diff --git a/keras/dtensor/__init__.py b/tf_keras/dtensor/__init__.py similarity index 100% rename from keras/dtensor/__init__.py rename to tf_keras/dtensor/__init__.py diff --git a/keras/dtensor/initializers_test.py b/tf_keras/dtensor/initializers_test.py similarity index 97% rename from keras/dtensor/initializers_test.py rename to tf_keras/dtensor/initializers_test.py index 11d97fca2..e199d18bc 100644 --- a/keras/dtensor/initializers_test.py +++ b/tf_keras/dtensor/initializers_test.py @@ -18,11 +18,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import backend -from keras import initializers -from keras.dtensor import dtensor_api as dtensor -from keras.dtensor import test_util -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras import initializers +from tf_keras.dtensor import dtensor_api as dtensor +from tf_keras.dtensor import test_util +from tf_keras.utils import tf_utils class InitializersTest(test_util.DTensorBaseTest): diff --git a/keras/dtensor/integration_test_utils.py b/tf_keras/dtensor/integration_test_utils.py similarity index 94% rename from keras/dtensor/integration_test_utils.py rename to tf_keras/dtensor/integration_test_utils.py index 3db7cc00d..4126dec04 100644 --- a/keras/dtensor/integration_test_utils.py +++ b/tf_keras/dtensor/integration_test_utils.py @@ -24,13 +24,13 @@ import tensorflow.compat.v2 as tf from absl import logging -from keras import layers -from keras import losses -from keras import models -from keras.datasets import mnist -from keras.dtensor import dtensor_api as dtensor -from keras.dtensor import layout_map as layout_map_lib -from keras.utils import np_utils +from tf_keras import layers +from tf_keras import losses +from tf_keras import models +from tf_keras.datasets import mnist +from tf_keras.dtensor import dtensor_api as dtensor +from tf_keras.dtensor import layout_map as layout_map_lib +from tf_keras.utils import np_utils NUM_CLASS = 10 # MNIST has 10 digits @@ -42,7 +42,7 @@ def get_model_with_layout_map(layout_map): layout_map: dict of string name -> Layout, for weights creation. Returns: - a CNN Keras model used for MNIST + a CNN TF-Keras model used for MNIST """ with layout_map_lib.layout_map_scope(layout_map): diff --git a/keras/dtensor/layers_test.py b/tf_keras/dtensor/layers_test.py similarity index 96% rename from keras/dtensor/layers_test.py rename to tf_keras/dtensor/layers_test.py index 5efc2b7a8..c535a8117 100644 --- a/keras/dtensor/layers_test.py +++ b/tf_keras/dtensor/layers_test.py @@ -18,11 +18,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import backend -from keras import layers -from keras.dtensor import dtensor_api as dtensor -from keras.dtensor import test_util -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras import layers +from tf_keras.dtensor import dtensor_api as dtensor +from tf_keras.dtensor import test_util +from tf_keras.utils import tf_utils class LayersTest(test_util.DTensorBaseTest): diff --git a/keras/dtensor/layout_map.py b/tf_keras/dtensor/layout_map.py similarity index 97% rename from keras/dtensor/layout_map.py rename to tf_keras/dtensor/layout_map.py index c7fd3407d..2a4a1f41a 100644 --- a/keras/dtensor/layout_map.py +++ b/tf_keras/dtensor/layout_map.py @@ -21,10 +21,10 @@ import tensorflow.compat.v2 as tf -from keras.dtensor import dtensor_api as dtensor -from keras.dtensor import lazy_variable -from keras.dtensor import utils -from keras.engine import base_layer +from tf_keras.dtensor import dtensor_api as dtensor +from tf_keras.dtensor import lazy_variable +from tf_keras.dtensor import utils +from tf_keras.engine import base_layer # isort: off from tensorflow.python.util.tf_export import keras_export @@ -157,11 +157,11 @@ def scope(self): For subclassed models, the full object/attribute name is used as the key. For Functional/Sequential models, we use `layer.name` as - the key for the layer, followed by the attribute name. Keras ensures + the key for the layer, followed by the attribute name. TF-Keras ensures name uniqueness among the layers within a Functional/Sequential model. See the following examples that show variable object names - for different Keras model types: + for different TF-Keras model types: ```python layout_map = layout_map_lib.LayoutMap(mesh=self.mesh) @@ -248,11 +248,11 @@ def layout_map_scope(layout_map): For subclassed models, the full object/attribute name is used as the key. For Functional/Sequential models, since the layers within the model do not get assigned to a meaningful attribute, we use `layer.name` as the key for - the layer, followed by the attribute name. Keras ensures name uniqueness + the layer, followed by the attribute name. TF-Keras ensures name uniqueness among the layers in all Functional/Sequential models. See the following examples that show the variable object names - for different Keras model types: + for different TF-Keras model types: ```python layout_map = layout_map_lib.LayoutMap(mesh=self.mesh) @@ -383,7 +383,7 @@ def _map_functional_model_variable(model, layout_map): for layer in model.layers: # Note that layer name is unique among the functional/sequential model - # when the layer name is not provided, Keras will auto generate a layer + # when the layer name is not provided, TF-Keras will auto generate a layer # name based on the class name. layer_name = layer.name for path, variable in layer._flatten( diff --git a/keras/dtensor/layout_map_test.py b/tf_keras/dtensor/layout_map_test.py similarity index 98% rename from keras/dtensor/layout_map_test.py rename to tf_keras/dtensor/layout_map_test.py index 7df61a78d..eb8c38e17 100644 --- a/keras/dtensor/layout_map_test.py +++ b/tf_keras/dtensor/layout_map_test.py @@ -20,13 +20,13 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import layers -from keras import models -from keras.dtensor import dtensor_api as dtensor -from keras.dtensor import layout_map as layout_map_lib -from keras.dtensor import test_util -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras import layers +from tf_keras import models +from tf_keras.dtensor import dtensor_api as dtensor +from tf_keras.dtensor import layout_map as layout_map_lib +from tf_keras.dtensor import test_util +from tf_keras.utils import tf_utils class LayoutMapTest(test_util.DTensorBaseTest): diff --git a/keras/dtensor/lazy_variable.py b/tf_keras/dtensor/lazy_variable.py similarity index 99% rename from keras/dtensor/lazy_variable.py rename to tf_keras/dtensor/lazy_variable.py index 1bf988713..68b168407 100644 --- a/keras/dtensor/lazy_variable.py +++ b/tf_keras/dtensor/lazy_variable.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Lazily initialized variables, useful for creating a symbolic Keras model.""" +"""Lazily initialized variables, useful for creating a symbolic TF-Keras model.""" import threading diff --git a/keras/dtensor/metrics_test.py b/tf_keras/dtensor/metrics_test.py similarity index 95% rename from keras/dtensor/metrics_test.py rename to tf_keras/dtensor/metrics_test.py index ddad4077e..b72609817 100644 --- a/keras/dtensor/metrics_test.py +++ b/tf_keras/dtensor/metrics_test.py @@ -18,10 +18,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import metrics -from keras.dtensor import dtensor_api as dtensor -from keras.dtensor import test_util -from keras.utils import tf_utils +from tf_keras import metrics +from tf_keras.dtensor import dtensor_api as dtensor +from tf_keras.dtensor import test_util +from tf_keras.utils import tf_utils class MetricsTest(test_util.DTensorBaseTest): diff --git a/keras/dtensor/mnist_model_test.py b/tf_keras/dtensor/mnist_model_test.py similarity index 93% rename from keras/dtensor/mnist_model_test.py rename to tf_keras/dtensor/mnist_model_test.py index 13cd15d5a..3bf5f5df2 100644 --- a/keras/dtensor/mnist_model_test.py +++ b/tf_keras/dtensor/mnist_model_test.py @@ -18,12 +18,12 @@ import tensorflow.compat.v2 as tf from tensorflow.compat.v2.experimental import dtensor -from keras import backend -from keras.dtensor import integration_test_utils -from keras.dtensor import layout_map as layout_map_lib -from keras.dtensor import test_util -from keras.optimizers import adam -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.dtensor import integration_test_utils +from tf_keras.dtensor import layout_map as layout_map_lib +from tf_keras.dtensor import test_util +from tf_keras.optimizers import adam +from tf_keras.utils import tf_utils class MnistTest(test_util.DTensorBaseTest): diff --git a/keras/dtensor/optimizers_test.py b/tf_keras/dtensor/optimizers_test.py similarity index 94% rename from keras/dtensor/optimizers_test.py rename to tf_keras/dtensor/optimizers_test.py index 356d2d296..669199a39 100644 --- a/keras/dtensor/optimizers_test.py +++ b/tf_keras/dtensor/optimizers_test.py @@ -20,19 +20,19 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import backend -from keras import layers -from keras import losses -from keras import models -from keras.dtensor import dtensor_api as dtensor -from keras.dtensor import layout_map -from keras.dtensor import test_util -from keras.optimizers import adadelta -from keras.optimizers import adagrad -from keras.optimizers import adam -from keras.optimizers import adamw -from keras.optimizers import rmsprop -from keras.optimizers import sgd +from tf_keras import backend +from tf_keras import layers +from tf_keras import losses +from tf_keras import models +from tf_keras.dtensor import dtensor_api as dtensor +from tf_keras.dtensor import layout_map +from tf_keras.dtensor import test_util +from tf_keras.optimizers import adadelta +from tf_keras.optimizers import adagrad +from tf_keras.optimizers import adam +from tf_keras.optimizers import adamw +from tf_keras.optimizers import rmsprop +from tf_keras.optimizers import sgd class OptimizersTest(test_util.DTensorBaseTest): diff --git a/keras/dtensor/save_load_test.py b/tf_keras/dtensor/save_load_test.py similarity index 92% rename from keras/dtensor/save_load_test.py rename to tf_keras/dtensor/save_load_test.py index e188c9ee4..8d06ba6d5 100644 --- a/keras/dtensor/save_load_test.py +++ b/tf_keras/dtensor/save_load_test.py @@ -17,13 +17,13 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import layers -from keras import models -from keras.dtensor import dtensor_api as dtensor -from keras.dtensor import layout_map as layout_map_lib -from keras.dtensor import test_util -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras import layers +from tf_keras import models +from tf_keras.dtensor import dtensor_api as dtensor +from tf_keras.dtensor import layout_map as layout_map_lib +from tf_keras.dtensor import test_util +from tf_keras.utils import tf_utils def _create_test_model(): diff --git a/keras/dtensor/strategy_integration_test.py b/tf_keras/dtensor/strategy_integration_test.py similarity index 95% rename from keras/dtensor/strategy_integration_test.py rename to tf_keras/dtensor/strategy_integration_test.py index 0f5d660b4..86d638ac8 100644 --- a/keras/dtensor/strategy_integration_test.py +++ b/tf_keras/dtensor/strategy_integration_test.py @@ -18,11 +18,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import backend -from keras import mixed_precision -from keras.dtensor import integration_test_utils -from keras.optimizers import adam -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras import mixed_precision +from tf_keras.dtensor import integration_test_utils +from tf_keras.optimizers import adam +from tf_keras.utils import tf_utils # isort: off # Import the MirroredStrategy that is backed by DTensor diff --git a/keras/dtensor/test_util.py b/tf_keras/dtensor/test_util.py similarity index 100% rename from keras/dtensor/test_util.py rename to tf_keras/dtensor/test_util.py diff --git a/keras/dtensor/utils.py b/tf_keras/dtensor/utils.py similarity index 95% rename from keras/dtensor/utils.py rename to tf_keras/dtensor/utils.py index 234ffe13c..4ae28f633 100644 --- a/keras/dtensor/utils.py +++ b/tf_keras/dtensor/utils.py @@ -18,7 +18,7 @@ import tensorflow.compat.v2 as tf -from keras.dtensor import dtensor_api as dtensor +from tf_keras.dtensor import dtensor_api as dtensor # All the variable names in the default keras layers. We will use those to map # against the args in the __init__ method to find corresponding layout args. @@ -72,11 +72,11 @@ def __init__(self, units, not passed to `BaseLayer.__init__`, which will raise error about unexpect keyword args. 2. Set the self.kernel/bias_layout attribute after the `__init__` method is - called. Keras framework will use those fields to create weights down the + called. TF-Keras framework will use those fields to create weights down the stream. Args: - init_method: the `__init__` method of the Keras layer to annotate. + init_method: the `__init__` method of the TF-Keras layer to annotate. Returns: the annotated __init__ method. @@ -128,7 +128,7 @@ def __init__(self, name='accuracy', dtype=None): ``` Args: - init_method: the `__init__` method of the Keras class to annotate. + init_method: the `__init__` method of the TF-Keras class to annotate. Returns: the annotated __init__ method. diff --git a/keras/dtensor/utils_test.py b/tf_keras/dtensor/utils_test.py similarity index 95% rename from keras/dtensor/utils_test.py rename to tf_keras/dtensor/utils_test.py index 407ecf149..61ced3123 100644 --- a/keras/dtensor/utils_test.py +++ b/tf_keras/dtensor/utils_test.py @@ -18,10 +18,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import layers -from keras.dtensor import dtensor_api as dtensor -from keras.dtensor import test_util -from keras.dtensor import utils +from tf_keras import layers +from tf_keras.dtensor import dtensor_api as dtensor +from tf_keras.dtensor import test_util +from tf_keras.dtensor import utils class UtilsTest(test_util.DTensorBaseTest): diff --git a/keras/engine/BUILD b/tf_keras/engine/BUILD similarity index 61% rename from keras/engine/BUILD rename to tf_keras/engine/BUILD index a2c40e878..3fde8013f 100644 --- a/keras/engine/BUILD +++ b/tf_keras/engine/BUILD @@ -1,18 +1,18 @@ # Description: -# Contains the Keras engine API (internal TensorFlow version). +# Contains the TF-Keras engine API (internal TensorFlow version). # Placeholder: load unaliased py_library # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], # TODO(scottzhu): Remove non-keras deps from TF. - default_visibility = ["//keras:friends"], + default_visibility = ["//tf_keras:friends"], licenses = ["notice"], ) @@ -48,30 +48,30 @@ py_library( "//:expect_tensorboard_installed", "//:expect_tensorflow_installed", "//:expect_yaml_installed", - "//keras:activations", - "//keras:backend", - "//keras:callbacks", - "//keras:callbacks_v1", - "//keras:constraints", - "//keras:losses", - "//keras:regularizers", - "//keras/distribute", - "//keras/distribute:distribute_coordinator_utils", - "//keras/dtensor:layout_map", - "//keras/export:export_lib", - "//keras/initializers", - "//keras/metrics", - "//keras/mixed_precision:autocast_variable", - "//keras/mixed_precision:loss_scale_optimizer", - "//keras/mixed_precision:policy", - "//keras/optimizers", - "//keras/saving", - "//keras/utils:engine_utils", - "//keras/utils:metrics_utils", - "//keras/utils:mode_keys", - "//keras/utils:steps_per_execution_tuning", - "//keras/utils:tf_utils", - "//keras/utils:version_utils", + "//tf_keras:activations", + "//tf_keras:backend", + "//tf_keras:callbacks", + "//tf_keras:callbacks_v1", + "//tf_keras:constraints", + "//tf_keras:losses", + "//tf_keras:regularizers", + "//tf_keras/distribute", + "//tf_keras/distribute:distribute_coordinator_utils", + "//tf_keras/dtensor:layout_map", + "//tf_keras/export:export_lib", + "//tf_keras/initializers", + "//tf_keras/metrics", + "//tf_keras/mixed_precision:autocast_variable", + "//tf_keras/mixed_precision:loss_scale_optimizer", + "//tf_keras/mixed_precision:policy", + "//tf_keras/optimizers", + "//tf_keras/saving", + "//tf_keras/utils:engine_utils", + "//tf_keras/utils:metrics_utils", + "//tf_keras/utils:mode_keys", + "//tf_keras/utils:steps_per_execution_tuning", + "//tf_keras/utils:tf_utils", + "//tf_keras/utils:version_utils", ], ) @@ -81,10 +81,10 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/dtensor", - "//keras/utils:tf_inspect", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/dtensor", + "//tf_keras/utils:tf_inspect", + "//tf_keras/utils:tf_utils", ], ) @@ -100,23 +100,23 @@ py_library( ":input_spec", ":node", "//:expect_numpy_installed", - "//keras:backend", - "//keras:constraints", - "//keras/initializers", + "//tf_keras:backend", + "//tf_keras:constraints", + "//tf_keras/initializers", # TODO(keras-team): Fix the circular deps between layer and metrics. - # "//keras/metrics", - "//keras:regularizers", - "//keras/dtensor:lazy_variable", - "//keras/mixed_precision:autocast_variable", - "//keras/mixed_precision:loss_scale_optimizer", - "//keras/mixed_precision:policy", - "//keras/saving", - "//keras/utils:generic_utils", - "//keras/utils:layer_utils", - "//keras/utils:object_identity", - "//keras/utils:tf_utils", - "//keras/utils:traceback_utils", - "//keras/utils:version_utils", + # "//tf_keras/metrics", + "//tf_keras:regularizers", + "//tf_keras/dtensor:lazy_variable", + "//tf_keras/mixed_precision:autocast_variable", + "//tf_keras/mixed_precision:loss_scale_optimizer", + "//tf_keras/mixed_precision:policy", + "//tf_keras/saving", + "//tf_keras/utils:generic_utils", + "//tf_keras/utils:layer_utils", + "//tf_keras/utils:object_identity", + "//tf_keras/utils:tf_utils", + "//tf_keras/utils:traceback_utils", + "//tf_keras/utils:version_utils", "//:expect_tensorflow_installed", ], ) @@ -129,10 +129,10 @@ py_library( ":keras_tensor", ":node", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/distribute", - "//keras/saving", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/distribute", + "//tf_keras/saving", + "//tf_keras/utils:tf_utils", ], ) @@ -153,10 +153,10 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/distribute", - "//keras/utils:dataset_creator", - "//keras/utils:engine_utils", - "//keras/utils:tf_utils", + "//tf_keras/distribute", + "//tf_keras/utils:dataset_creator", + "//tf_keras/utils:engine_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -166,7 +166,7 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -176,7 +176,8 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/utils:object_identity", + "//tf_keras/utils:object_identity", + "//third_party/tensorflow/python/framework:none_tensor", ], ) @@ -189,7 +190,7 @@ py_library( deps = [ ":base_layer", "//:expect_tensorflow_installed", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -201,8 +202,8 @@ py_library( ":base_layer_utils", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/utils:tf_utils", ], ) @@ -216,9 +217,9 @@ tf_py_test( deps = [ ":base_layer_utils", "//:expect_tensorflow_installed", - "//keras", - "//keras:backend", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras:backend", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -237,8 +238,8 @@ tf_py_test( "//:expect_numpy_installed", "//:expect_pandas_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -252,10 +253,10 @@ tf_py_test( ], deps = [ ":base_preprocessing_layer", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -268,10 +269,10 @@ tf_py_test( ":functional_utils", ":input_layer", "//:expect_tensorflow_installed", - "//keras", - "//keras/layers", - "//keras/models", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/layers", + "//tf_keras/models", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -286,13 +287,13 @@ cuda_py_test( deps = [ ":engine", ":input_layer", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/layers/convolutional", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras:backend", + "//tf_keras/layers/convolutional", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -307,11 +308,11 @@ tf_py_test( "notsan", ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -324,10 +325,10 @@ tf_py_test( "nomac", # TODO(mihaimaruseac): b/127695564 ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -340,10 +341,10 @@ tf_py_test( "nomac", # TODO(mihaimaruseac): b/127695564 ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -356,9 +357,9 @@ tf_py_test( "nomac", # TODO(mihaimaruseac): b/127695564 ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -374,20 +375,20 @@ tf_py_test( ], deps = [ ":engine", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras:backend", - "//keras:callbacks", - "//keras:losses", - "//keras/layers", - "//keras/metrics", - "//keras/mixed_precision:policy", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:data_utils", - "//keras/utils:np_utils", + "//tf_keras", + "//tf_keras:backend", + "//tf_keras:callbacks", + "//tf_keras:losses", + "//tf_keras/layers", + "//tf_keras/metrics", + "//tf_keras/mixed_precision:policy", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:data_utils", + "//tf_keras/utils:np_utils", ], ) @@ -399,11 +400,11 @@ tf_py_test( "nomac", # TODO(b/146226927) ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -417,11 +418,11 @@ tf_py_test( "nomac", # TODO(mihaimaruseac): b/127695564 ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -434,12 +435,12 @@ tf_py_test( "nomac", # TODO(mihaimaruseac): b/127695564 ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/layers", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/layers", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -456,17 +457,17 @@ tf_py_test( ], deps = [ ":engine", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras:losses", - "//keras/layers", - "//keras/metrics", - "//keras/optimizers/legacy:optimizers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:data_utils", + "//tf_keras", + "//tf_keras:losses", + "//tf_keras/layers", + "//tf_keras/metrics", + "//tf_keras/optimizers/legacy:optimizers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:data_utils", ], ) @@ -480,11 +481,11 @@ tf_py_test( "nomac", # TODO(mihaimaruseac): b/127695564 ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -498,11 +499,11 @@ tf_py_test( "notsan", ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -516,11 +517,11 @@ tf_py_test( "notsan", ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -534,11 +535,11 @@ tf_py_test( "notsan", ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -554,10 +555,10 @@ tf_py_test( deps = [ ":base_layer", ":engine", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:layer_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:layer_utils", ], ) @@ -577,15 +578,15 @@ tf_py_test( ":engine", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras:backend", - "//keras/initializers", - "//keras/layers", - "//keras/models", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:layer_utils", - "//keras/utils:tf_utils", + "//tf_keras", + "//tf_keras:backend", + "//tf_keras/initializers", + "//tf_keras/layers", + "//tf_keras/models", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:layer_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -601,10 +602,10 @@ tf_py_test( deps = [ ":base_layer", ":engine", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:layer_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:layer_utils", ], ) @@ -623,16 +624,16 @@ tf_py_test( "//:expect_numpy_installed", "//:expect_tensorboard_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras:backend", - "//keras:regularizers", - "//keras/layers", - "//keras/legacy_tf_layers:core", - "//keras/mixed_precision:policy", - "//keras/optimizers/legacy:optimizers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:tf_utils", + "//tf_keras", + "//tf_keras:backend", + "//tf_keras:regularizers", + "//tf_keras/layers", + "//tf_keras/legacy_tf_layers:core", + "//tf_keras/mixed_precision:policy", + "//tf_keras/optimizers/legacy:optimizers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -646,11 +647,11 @@ tf_py_test( "nomac", # TODO(mihaimaruseac): b/127695564 ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -664,11 +665,11 @@ tf_py_test( "nomac", # TODO(mihaimaruseac): b/127695564 ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -681,10 +682,10 @@ tf_py_test( "nomac", # TODO(mihaimaruseac): b/127695564 ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/keras/engine/__init__.py b/tf_keras/engine/__init__.py similarity index 100% rename from keras/engine/__init__.py rename to tf_keras/engine/__init__.py diff --git a/keras/engine/base_layer.py b/tf_keras/engine/base_layer.py similarity index 98% rename from keras/engine/base_layer.py rename to tf_keras/engine/base_layer.py index 4e4039631..3c342ca1c 100644 --- a/keras/engine/base_layer.py +++ b/tf_keras/engine/base_layer.py @@ -28,30 +28,30 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.dtensor import lazy_variable -from keras.engine import base_layer_utils -from keras.engine import input_spec -from keras.engine import keras_tensor -from keras.engine import node as node_module -from keras.mixed_precision import autocast_variable -from keras.mixed_precision import policy -from keras.saving import serialization_lib -from keras.saving.legacy.saved_model import layer_serialization -from keras.utils import generic_utils -from keras.utils import layer_utils -from keras.utils import object_identity -from keras.utils import tf_inspect -from keras.utils import tf_utils -from keras.utils import traceback_utils -from keras.utils import version_utils +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.dtensor import lazy_variable +from tf_keras.engine import base_layer_utils +from tf_keras.engine import input_spec +from tf_keras.engine import keras_tensor +from tf_keras.engine import node as node_module +from tf_keras.mixed_precision import autocast_variable +from tf_keras.mixed_precision import policy +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy.saved_model import layer_serialization +from tf_keras.utils import generic_utils +from tf_keras.utils import layer_utils +from tf_keras.utils import object_identity +from tf_keras.utils import tf_inspect +from tf_keras.utils import tf_utils +from tf_keras.utils import traceback_utils +from tf_keras.utils import version_utils # A module that only depends on `keras.layers` import these from here. -from keras.utils.generic_utils import to_snake_case # noqa: F401 -from keras.utils.tf_utils import is_tensor_or_tensor_list # noqa: F401 +from tf_keras.utils.generic_utils import to_snake_case # noqa: F401 +from tf_keras.utils.tf_utils import is_tensor_or_tensor_list # noqa: F401 # isort: off from google.protobuf import json_format @@ -64,7 +64,7 @@ metrics_mod = generic_utils.LazyLoader( - "metrics_mod", globals(), "keras.metrics" + "metrics_mod", globals(), "tf_keras.metrics" ) @@ -76,16 +76,16 @@ _AUTOCAST_TYPES = (tf.Tensor, tf.SparseTensor, tf.RaggedTensor) keras_layers_gauge = tf.__internal__.monitoring.BoolGauge( - "/tensorflow/api/keras/layers", "keras layers usage", "method" + "/tensorflow/api/tf_keras/layers", "keras layers usage", "method" ) keras_models_gauge = tf.__internal__.monitoring.BoolGauge( - "/tensorflow/api/keras/models", "keras model usage", "method" + "/tensorflow/api/tf_keras/models", "keras model usage", "method" ) keras_api_gauge = tf.__internal__.monitoring.BoolGauge( "/tensorflow/api/keras", "keras api usage", "method" ) keras_premade_model_gauge = tf.__internal__.monitoring.BoolGauge( - "/tensorflow/api/keras/premade_models", "premade keras model usage", "type" + "/tensorflow/api/tf_keras/premade_models", "premade keras model usage", "type" ) _is_name_scope_on_model_declaration_enabled = False @@ -203,11 +203,11 @@ class Layer(tf.Module, version_utils.LayerVersionSelector): Two reserved keyword arguments you can optionally use in `call()` are: - `training` (boolean, whether the call is in inference mode or training mode). See more details in [the layer/model subclassing guide]( - https://www.tensorflow.org/guide/keras/custom_layers_and_models#privileged_training_argument_in_the_call_method) + https://www.tensorflow.org/guide/tf_keras/custom_layers_and_models#privileged_training_argument_in_the_call_method) - `mask` (boolean tensor encoding masked timesteps in the input, used in RNN layers). See more details in [the layer/model subclassing guide]( - https://www.tensorflow.org/guide/keras/custom_layers_and_models#privileged_mask_argument_in_the_call_method) + https://www.tensorflow.org/guide/tf_keras/custom_layers_and_models#privileged_mask_argument_in_the_call_method) A typical signature for this method is `call(self, inputs)`, and user could optionally add `training` and `mask` if the layer need them. `*args` and `**kwargs` is only useful for future extension when more input @@ -313,7 +313,7 @@ def call(self, inputs): For more information about creating layers, see the guide [Making new Layers and Models via subclassing]( - https://www.tensorflow.org/guide/keras/custom_layers_and_models) + https://www.tensorflow.org/guide/tf_keras/custom_layers_and_models) """ @tf.__internal__.tracking.no_automatic_dependency_tracking @@ -518,7 +518,7 @@ def call(self, inputs, *args, **kwargs): of a keyword argument. - NumPy array or Python scalar values in `inputs` get cast as tensors. - - Keras mask metadata is only collected from `inputs`. + - TF-Keras mask metadata is only collected from `inputs`. - Layers are built (`build(input_shape)` method) using shape info from `inputs` only. - `input_spec` compatibility is only checked against `inputs`. @@ -541,7 +541,7 @@ def call(self, inputs, *args, **kwargs): `mask` argument, its default value will be set to the mask generated for `inputs` by the previous layer (if `input` did come from a layer that generated a corresponding mask, i.e. if it came - from a Keras layer with masking support). + from a TF-Keras layer with masking support). Returns: A tensor or list/tuple of tensors. @@ -1023,7 +1023,7 @@ def __call__(self, *args, **kwargs): layers do), its default value will be set to the mask generated for `inputs` by the previous layer (if `input` did come from a layer that generated a corresponding mask, i.e. if it came from - a Keras layer with masking support. + a TF-Keras layer with masking support. - If the layer is not built, the method will call `build`. Raises: @@ -1704,7 +1704,7 @@ def call(self, inputs): "Tensor to monitor directly." ) - # Insert layers into the Keras Graph Network. + # Insert layers into the TF-Keras Graph Network. aggregation = None if from_metric_obj else "mean" self._graph_network_add_metric(value, aggregation, name) @@ -2258,7 +2258,7 @@ def variables(self): Alias of `self.weights`. Note: This will not track the weights of nested `tf.Modules` that are - not themselves Keras layers. + not themselves TF-Keras layers. Returns: A list of variables. @@ -2296,7 +2296,7 @@ def get_build_config(self): By default, the config only contains the input shape that the layer was built with. If you're writing a custom layer that creates state in an unusual way, you should override this method to make sure this state - is already created when Keras attempts to load its value upon model + is already created when TF-Keras attempts to load its value upon model loading. Returns: @@ -3479,7 +3479,7 @@ def _trackable_children(self, save_type="checkpoint", **kwargs): def _use_input_spec_as_call_signature(self): # Whether input spec can be used as the call signature when tracing the # Layer for SavedModel. By default, this is set to `True` for layers - # exported from the Keras library, because the layers more rigidly + # exported from the TF-Keras library, because the layers more rigidly # define the `input_specs` property (many custom layers only set the # `ndims`) return ( @@ -3546,7 +3546,7 @@ class TensorFlowOpLayer(Layer): uses a raw TensorFlow Operation on symbolic tensors originating from an `Input` Layer, the resultant operation will be wrapped with this Layer object in order to make the operation compatible - with the Keras API. + with the TF-Keras API. This Layer will create a new, identical operation (except for inputs and outputs) every time it is called. If `run_eagerly` is `True`, @@ -3554,15 +3554,15 @@ class TensorFlowOpLayer(Layer): Instances of this Layer are created when `autolambda` is called, which is whenever a Layer's `__call__` encounters symbolic inputs that do - not have Keras metadata, or when a Network's `__init__` encounters - outputs that do not have Keras metadata. + not have TF-Keras metadata, or when a Network's `__init__` encounters + outputs that do not have TF-Keras metadata. Attributes: node_def: String, the serialized NodeDef of the Op this layer will wrap. name: String, the name of the Layer. constants: Dict of NumPy arrays, the values of any Tensors needed for this - Operation that do not originate from a Keras `Input` Layer. Since all - placeholders must come from Keras `Input` Layers, these Tensors must be + Operation that do not originate from a TF-Keras `Input` Layer. Since all + placeholders must come from TF-Keras `Input` Layers, these Tensors must be treated as constant in the Functional API. trainable: Bool, whether this Layer is trainable. Currently Variables are not supported, and so this parameter has no effect. @@ -3836,7 +3836,7 @@ def _trackable_children(self, save_type="checkpoint", **kwargs): return children def _lookup_dependency(self, name, cached_dependencies=None): - # When loading from a Keras SavedModel load, make sure that the loader + # When loading from a TF-Keras SavedModel load, make sure that the loader # can find the random generator, otherwise the loader will assume that # it does not exist, and will try to create a new generator. if name == "_random_generator": diff --git a/keras/engine/base_layer_test.py b/tf_keras/engine/base_layer_test.py similarity index 99% rename from keras/engine/base_layer_test.py rename to tf_keras/engine/base_layer_test.py index 0389ea512..045775fa1 100644 --- a/keras/engine/base_layer_test.py +++ b/tf_keras/engine/base_layer_test.py @@ -19,18 +19,18 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import layers -from keras import regularizers -from keras.engine import base_layer -from keras.engine import input_layer -from keras.engine import sequential -from keras.engine import training as training_lib -from keras.legacy_tf_layers import core as legacy_core -from keras.optimizers.legacy import rmsprop -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import control_flow_util +from tf_keras import backend +from tf_keras import layers +from tf_keras import regularizers +from tf_keras.engine import base_layer +from tf_keras.engine import input_layer +from tf_keras.engine import sequential +from tf_keras.engine import training as training_lib +from tf_keras.legacy_tf_layers import core as legacy_core +from tf_keras.optimizers.legacy import rmsprop +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import control_flow_util class DynamicLayer(base_layer.Layer): @@ -1128,14 +1128,14 @@ def test_using_symbolic_tensors_with_tf_ops(self): x1, x2 = input_layer.Input((3,)), input_layer.Input((3,)) tf.concat([x1, x2], axis=1) - # Mixing Keras symbolic tensors and graph tensors from the same graph + # Mixing TF-Keras symbolic tensors and graph tensors from the same graph # works. with backend.get_graph().as_default(): x1 = input_layer.Input((3,)) x2 = input_layer.Input((3,)) tf.matmul(x1, x2) - # Creating same op type (matmul) multiple times in the Keras graph + # Creating same op type (matmul) multiple times in the TF-Keras graph # works. x1 = input_layer.Input((3,)) x2 = input_layer.Input((3,)) diff --git a/keras/engine/base_layer_utils.py b/tf_keras/engine/base_layer_utils.py similarity index 95% rename from keras/engine/base_layer_utils.py rename to tf_keras/engine/base_layer_utils.py index 8e3de3d4d..ffa10f4d7 100644 --- a/keras/engine/base_layer_utils.py +++ b/tf_keras/engine/base_layer_utils.py @@ -20,11 +20,11 @@ import tensorflow.compat.v1 as tf1 import tensorflow.compat.v2 as tf -from keras import backend -from keras.dtensor import dtensor_api as dtensor -from keras.utils import control_flow_util -from keras.utils import tf_inspect -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.dtensor import dtensor_api as dtensor +from tf_keras.utils import control_flow_util +from tf_keras.utils import tf_inspect +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -35,7 +35,7 @@ def create_mean_metric(value, name=None): # import keras will import base_layer and then this module, and metric # relies on base_layer, which result into a cyclic dependency. - from keras import metrics as metrics_module + from tf_keras import metrics as metrics_module metric_obj = metrics_module.Mean(name=name, dtype=value.dtype) return metric_obj, metric_obj(value) @@ -192,17 +192,17 @@ def generate_placeholders_from_shape(shape): def create_keras_history(tensors): """Wraps TensorFlow Operations for compatibility with the Functional API. - This method checks to see if a Tensor in `tensors` is missing Keras metadata - and has its origin in a Keras `Input` Layer. If so, this method will replace + This method checks to see if a Tensor in `tensors` is missing TF-Keras metadata + and has its origin in a TF-Keras `Input` Layer. If so, this method will replace the raw TensorFlow Operations that created this tensor with `TensorFlowOpLayer` instances that create identical operations. - Any Tensors not originating from a Keras `Input` Layer will be treated as + Any Tensors not originating from a TF-Keras `Input` Layer will be treated as constants when constructing `TensorFlowOpLayer` instances. Args: tensors: A structure of Tensors, some of which come from raw TensorFlow - operations and need to have Keras metadata assigned to them. + operations and need to have TF-Keras metadata assigned to them. Returns: created_layers: List. The `TensorFlowOpLayer` instances created to wrap @@ -213,7 +213,7 @@ def create_keras_history(tensors): # Unsafe Internal attribute. -# If True, Keras will not evaluate the constant-foldable inputs to tf op +# If True, TF-Keras will not evaluate the constant-foldable inputs to tf op # layers in TF1 graphs. This *might* speed up model construction time in # certain settings, but it means # the models will not be serializable/deserializable via get_config @@ -229,7 +229,7 @@ def _create_keras_history_helper(tensors, processed_ops, created_layers): """Helper method for `create_keras_history`. Args: - tensors: A structure of Tensors for which to create Keras metadata. + tensors: A structure of Tensors for which to create TF-Keras metadata. processed_ops: Set. TensorFlow operations that have already been wrapped in `TensorFlowOpLayer` instances. created_layers: List. The `TensorFlowOpLayer` instances created. @@ -246,7 +246,7 @@ def _create_keras_history_helper(tensors, processed_ops, created_layers): # Import of `base_layer` needed in order to create `TensorFlowOpLayer`. # Cannot be imported at top because of circular dependencies. # TODO(omalleyt): Resolve circular dependency. - from keras.engine import base_layer + from tf_keras.engine import base_layer tensor_list = tf.nest.flatten(tensors) sparse_ops = [] @@ -314,7 +314,7 @@ def _create_keras_history_helper(tensors, processed_ops, created_layers): """ raise ValueError( "Tensorflow ops that generate ragged or sparse tensor " - "outputs are currently not supported by Keras automatic " + "outputs are currently not supported by TF-Keras automatic " "op wrapping. Please wrap these ops in a Lambda layer: " "\n\n```\n{example}\n```\n" "Sparse ops encountered: {sparse_ops}\n" @@ -342,7 +342,7 @@ def needs_keras_history(tensors, ignore_call_context=False): """Check if any Tensors need to be wrapped in TensorFlowOpLayers. This will never return True inside a sublayer, because sublayers - do not need to create Keras History. Otherwise, this returns True + do not need to create TF-Keras History. Otherwise, this returns True if one or more of `tensors` originates from a `keras.Input` and does not have `_keras_history` set. @@ -369,7 +369,7 @@ def needs_keras_history(tensors, ignore_call_context=False): def is_in_keras_graph(): - """Returns if currently executing inside of a Keras graph.""" + """Returns if currently executing inside of a TF-Keras graph.""" return call_context().in_keras_graph @@ -385,7 +385,7 @@ def is_in_tf_function(): return False if not tf.inside_function(): return False - # Check if inside Keras FuncGraph. + # Check if inside TF-Keras FuncGraph. if is_in_keras_graph(): return False # Check for a v1 `wrap_function` FuncGraph. @@ -468,7 +468,7 @@ def call_context(): # Inject the call_context function to keras_deps to remove the dependency -# from TFLite to Keras. +# from TFLite to TF-Keras. tf.__internal__.register_call_context_function(call_context) @@ -484,7 +484,7 @@ class CallContext: saving: Whether currently saving to SavedModel. frozen: Whether currently executing inside a `Layer` with `trainable` set to `False`. - in_keras_graph: Whether executing inside the Keras Graph. + in_keras_graph: Whether executing inside the TF-Keras Graph. """ def __init__(self): @@ -553,7 +553,7 @@ def frozen(self): @property def in_keras_graph(self): - # Returns True even if in a subgraph of the Keras graph, such as those + # Returns True even if in a subgraph of the TF-Keras graph, such as those # created by control flow ops. if tf.executing_eagerly(): return False @@ -619,7 +619,7 @@ def from_saved_model(layer): def check_graph_consistency(tensor=None, method="add_loss", force_raise=False): - """Checks that tensors passed to `add_*` method match the Keras graph. + """Checks that tensors passed to `add_*` method match the TF-Keras graph. When one of the `add_*` method is called inside a V2 conditional branch, the underlying tensor gets created in a FuncGraph managed by control_flow_v2. @@ -776,15 +776,15 @@ def _mark_as_return(tensor): @keras_export(v1=["keras.layers.enable_v2_dtype_behavior"]) def enable_v2_dtype_behavior(): - """Enable the V2 dtype behavior for Keras layers. + """Enable the V2 dtype behavior for TF-Keras layers. By default, the V2 dtype behavior is enabled in TensorFlow 2, so this function is only useful if `tf.compat.v1.disable_v2_behavior` has been called. Since mixed precision requires V2 dtype behavior to be enabled, this - function allows you to use mixed precision in Keras layers if + function allows you to use mixed precision in TF-Keras layers if `disable_v2_behavior` has been called. - When enabled, the dtype of Keras layers defaults to floatx (which is + When enabled, the dtype of TF-Keras layers defaults to floatx (which is typically float32) instead of None. In addition, layers will automatically cast floating-point inputs to the layer's dtype. @@ -801,7 +801,7 @@ def enable_v2_dtype_behavior(): autocasting part of the V2 behavior for that layer, but not the defaulting to floatx part of the V2 behavior. - When a global `tf.keras.mixed_precision.Policy` is set, a Keras layer's + When a global `tf.keras.mixed_precision.Policy` is set, a TF-Keras layer's dtype will default to the global policy instead of floatx. Layers will automatically cast inputs to the policy's compute_dtype. """ @@ -811,7 +811,7 @@ def enable_v2_dtype_behavior(): @keras_export(v1=["keras.layers.disable_v2_dtype_behavior"]) def disable_v2_dtype_behavior(): - """Disables the V2 dtype behavior for Keras layers. + """Disables the V2 dtype behavior for TF-Keras layers. See `tf.compat.v1.keras.layers.enable_v2_dtype_behavior`. """ diff --git a/keras/engine/base_layer_utils_test.py b/tf_keras/engine/base_layer_utils_test.py similarity index 96% rename from keras/engine/base_layer_utils_test.py rename to tf_keras/engine/base_layer_utils_test.py index 67a4d2d5d..dd8d96a07 100644 --- a/keras/engine/base_layer_utils_test.py +++ b/tf_keras/engine/base_layer_utils_test.py @@ -16,10 +16,10 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras import backend -from keras.engine import base_layer_utils -from keras.testing_infra import test_combinations +import tf_keras as keras +from tf_keras import backend +from tf_keras.engine import base_layer_utils +from tf_keras.testing_infra import test_combinations @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/engine/base_layer_v1.py b/tf_keras/engine/base_layer_v1.py similarity index 98% rename from keras/engine/base_layer_v1.py rename to tf_keras/engine/base_layer_v1.py index e54211473..000de1c45 100644 --- a/keras/engine/base_layer_v1.py +++ b/tf_keras/engine/base_layer_v1.py @@ -23,26 +23,26 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine import base_layer -from keras.engine import base_layer_utils -from keras.engine import input_spec -from keras.mixed_precision import autocast_variable -from keras.mixed_precision import loss_scale_optimizer -from keras.mixed_precision import policy -from keras.saving.legacy.saved_model import layer_serialization -from keras.utils import generic_utils -from keras.utils import layer_utils -from keras.utils import object_identity -from keras.utils import tf_inspect -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine import base_layer +from tf_keras.engine import base_layer_utils +from tf_keras.engine import input_spec +from tf_keras.mixed_precision import autocast_variable +from tf_keras.mixed_precision import loss_scale_optimizer +from tf_keras.mixed_precision import policy +from tf_keras.saving.legacy.saved_model import layer_serialization +from tf_keras.utils import generic_utils +from tf_keras.utils import layer_utils +from tf_keras.utils import object_identity +from tf_keras.utils import tf_inspect +from tf_keras.utils import tf_utils # A module that only depends on `keras.layers` import these from here. -from keras.utils.generic_utils import to_snake_case # noqa: F401 -from keras.utils.tf_utils import is_tensor_or_tensor_list # noqa: F401 +from tf_keras.utils.generic_utils import to_snake_case # noqa: F401 +from tf_keras.utils.tf_utils import is_tensor_or_tensor_list # noqa: F401 # isort: off from tensorflow.python.platform import tf_logging @@ -691,7 +691,7 @@ def __call__(self, *args, **kwargs): layers do), its default value will be set to the mask generated for `inputs` by the previous layer (if `input` did come from a layer that generated a corresponding mask, i.e. if it came from - a Keras layer with masking support. + a TF-Keras layer with masking support. Raises: ValueError: if the layer's `call` method returns None (an invalid @@ -791,9 +791,9 @@ def _convert_non_tensor(x): ) training_arg_passed_by_framework = True - # Only create Keras history if at least one tensor originates from a + # Only create TF-Keras history if at least one tensor originates from a # `keras.Input`. Otherwise this Layer may be being used outside the - # Keras framework. + # TF-Keras framework. if build_graph and base_layer_utils.needs_keras_history(inputs): base_layer_utils.create_keras_history(inputs) @@ -884,7 +884,7 @@ def _convert_non_tensor(x): # set by a call to self._set_inputs(). # TODO(b/120997007): This should be done in Eager as # well, but causes garbage collection issues because of - # the placeholders created on the default Keras graph. + # the placeholders created on the default TF-Keras graph. self._set_save_spec(inputs, args, kwargs) self._set_inputs(inputs, outputs) else: @@ -1238,7 +1238,7 @@ def add_metric(self, value, aggregation=None, name=None): "Tensor to monitor directly." ) - # Insert layers into the Keras Graph Network. + # Insert layers into the TF-Keras Graph Network. self._graph_network_add_metric(value, aggregation, name) @doc_controls.for_subclass_implementers @@ -1784,13 +1784,13 @@ def output_shape(self): @property @doc_controls.do_not_doc_inheritable def inbound_nodes(self): - """Deprecated, do NOT use! Only for external Keras compatibility .""" + """Deprecated, do NOT use! Only for external TF-Keras compatibility .""" return self._inbound_nodes @property @doc_controls.do_not_doc_inheritable def outbound_nodes(self): - """Deprecated, do NOT use! Only for external Keras compatibility .""" + """Deprecated, do NOT use! Only for external TF-Keras compatibility .""" return self._outbound_nodes ########################################################################### @@ -2347,7 +2347,7 @@ def __setattr__(self, name, value): pass # Keep track of metric instance created in subclassed layer. - from keras import metrics as metrics_module + from tf_keras import metrics as metrics_module for val in tf.nest.flatten(value): if isinstance(val, metrics_module.Metric) and hasattr( diff --git a/keras/engine/base_preprocessing_layer.py b/tf_keras/engine/base_preprocessing_layer.py similarity index 98% rename from keras/engine/base_preprocessing_layer.py rename to tf_keras/engine/base_preprocessing_layer.py index bdd32405e..af55c9c0a 100644 --- a/keras/engine/base_preprocessing_layer.py +++ b/tf_keras/engine/base_preprocessing_layer.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf -from keras.engine import data_adapter -from keras.engine.base_layer import Layer -from keras.utils import version_utils +from tf_keras.engine import data_adapter +from tf_keras.engine.base_layer import Layer +from tf_keras.utils import version_utils # isort: off from tensorflow.python.eager import context @@ -28,7 +28,7 @@ from tensorflow.tools.docs import doc_controls keras_kpl_gauge = tf.__internal__.monitoring.BoolGauge( - "/tensorflow/api/keras/layers/preprocessing", + "/tensorflow/api/tf_keras/layers/preprocessing", "keras preprocessing layers usage", "method", ) diff --git a/keras/engine/base_preprocessing_layer_test.py b/tf_keras/engine/base_preprocessing_layer_test.py similarity index 98% rename from keras/engine/base_preprocessing_layer_test.py rename to tf_keras/engine/base_preprocessing_layer_test.py index af4344fd5..f2cb6e05c 100644 --- a/keras/engine/base_preprocessing_layer_test.py +++ b/tf_keras/engine/base_preprocessing_layer_test.py @@ -19,10 +19,10 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.engine import base_preprocessing_layer -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.engine import base_preprocessing_layer +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # Define a test-only implementation of BasePreprocessingLayer to validate diff --git a/keras/engine/compile_utils.py b/tf_keras/engine/compile_utils.py similarity index 99% rename from keras/engine/compile_utils.py rename to tf_keras/engine/compile_utils.py index 5d443654c..39ceb891d 100644 --- a/keras/engine/compile_utils.py +++ b/tf_keras/engine/compile_utils.py @@ -20,12 +20,12 @@ import tensorflow.compat.v2 as tf -from keras import losses as losses_mod -from keras import metrics as metrics_mod -from keras.saving import saving_lib -from keras.utils import generic_utils -from keras.utils import losses_utils -from keras.utils import tf_utils +from tf_keras import losses as losses_mod +from tf_keras import metrics as metrics_mod +from tf_keras.saving import saving_lib +from tf_keras.utils import generic_utils +from tf_keras.utils import losses_utils +from tf_keras.utils import tf_utils class Container: diff --git a/keras/engine/compile_utils_test.py b/tf_keras/engine/compile_utils_test.py similarity index 99% rename from keras/engine/compile_utils_test.py rename to tf_keras/engine/compile_utils_test.py index 557d6e2b4..6bd9c4c4e 100644 --- a/keras/engine/compile_utils_test.py +++ b/tf_keras/engine/compile_utils_test.py @@ -16,11 +16,11 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras import losses as losses_mod -from keras import metrics as metrics_mod -from keras.engine import compile_utils -from keras.testing_infra import test_combinations +from tf_keras import backend +from tf_keras import losses as losses_mod +from tf_keras import metrics as metrics_mod +from tf_keras.engine import compile_utils +from tf_keras.testing_infra import test_combinations class LossesContainerTest(test_combinations.TestCase): diff --git a/keras/engine/control_flow_test.py b/tf_keras/engine/control_flow_test.py similarity index 93% rename from keras/engine/control_flow_test.py rename to tf_keras/engine/control_flow_test.py index 161e05d24..1953ca6d5 100644 --- a/keras/engine/control_flow_test.py +++ b/tf_keras/engine/control_flow_test.py @@ -12,17 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for dynamic control flow behavior with Keras.""" +"""Tests for dynamic control flow behavior with TF-Keras.""" import numpy as np import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.engine import base_layer -from keras.optimizers.legacy import rmsprop -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.engine import base_layer +from tf_keras.optimizers.legacy import rmsprop +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class ControlFlowLayer1(base_layer.Layer): diff --git a/keras/engine/correctness_test.py b/tf_keras/engine/correctness_test.py similarity index 97% rename from keras/engine/correctness_test.py rename to tf_keras/engine/correctness_test.py index 6b16e247c..14ac0a5b7 100644 --- a/keras/engine/correctness_test.py +++ b/tf_keras/engine/correctness_test.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class MultiInputSubclassed(keras.Model): diff --git a/keras/engine/data_adapter.py b/tf_keras/engine/data_adapter.py similarity index 99% rename from keras/engine/data_adapter.py rename to tf_keras/engine/data_adapter.py index 517684e75..491eeec25 100644 --- a/keras/engine/data_adapter.py +++ b/tf_keras/engine/data_adapter.py @@ -24,12 +24,12 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.distribute import distributed_training_utils -from keras.engine import training_utils -from keras.utils import data_utils -from keras.utils import dataset_creator -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.distribute import distributed_training_utils +from tf_keras.engine import training_utils +from tf_keras.utils import data_utils +from tf_keras.utils import dataset_creator +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.distribute.input_lib import ( @@ -53,7 +53,7 @@ pd = None keras_data_adapter_gauge = tf.__internal__.monitoring.BoolGauge( - "/tensorflow/api/keras/data_adapters", "keras data adapter usage", "method" + "/tensorflow/api/tf_keras/data_adapters", "keras data adapter usage", "method" ) @@ -139,7 +139,7 @@ def get_dataset(self): Returns: A `tf.data.Dataset`. Caller might use the dataset in different context, e.g. iter(dataset) in eager to get the value directly, or in - graph mode, provide the iterator tensor to Keras model function. + graph mode, provide the iterator tensor to TF-Keras model function. """ raise NotImplementedError @@ -469,7 +469,7 @@ def _is_array_like(v): def __init__(self, *args, **kwargs): logging.warning( - "Keras is training/fitting/evaluating on array-like data. Keras " + "Keras is training/fitting/evaluating on array-like data. TF-Keras " "may not be optimized for this format, so if your input data " "format is supported by TensorFlow I/O " "(https://github.com/tensorflow/io) we recommend using that to " diff --git a/keras/engine/data_adapter_test.py b/tf_keras/engine/data_adapter_test.py similarity index 99% rename from keras/engine/data_adapter_test.py rename to tf_keras/engine/data_adapter_test.py index 2a480b385..b9314e9fa 100644 --- a/keras/engine/data_adapter_test.py +++ b/tf_keras/engine/data_adapter_test.py @@ -20,11 +20,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.engine import data_adapter -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import data_utils +import tf_keras as keras +from tf_keras.engine import data_adapter +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import data_utils # isort: off from tensorflow.python.eager import context diff --git a/keras/engine/deferred_sequential_test.py b/tf_keras/engine/deferred_sequential_test.py similarity index 98% rename from keras/engine/deferred_sequential_test.py rename to tf_keras/engine/deferred_sequential_test.py index 8d72abbef..97329f470 100644 --- a/keras/engine/deferred_sequential_test.py +++ b/tf_keras/engine/deferred_sequential_test.py @@ -20,9 +20,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils try: import h5py diff --git a/keras/engine/feature_columns_integration_test.py b/tf_keras/engine/feature_columns_integration_test.py similarity index 97% rename from keras/engine/feature_columns_integration_test.py rename to tf_keras/engine/feature_columns_integration_test.py index 427a8c70b..f755330c1 100644 --- a/keras/engine/feature_columns_integration_test.py +++ b/tf_keras/engine/feature_columns_integration_test.py @@ -17,12 +17,12 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras import metrics as metrics_module -from keras.feature_column import dense_features as df -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import np_utils +import tf_keras as keras +from tf_keras import metrics as metrics_module +from tf_keras.feature_column import dense_features as df +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import np_utils class TestDNNModel(keras.models.Model): diff --git a/keras/engine/functional.py b/tf_keras/engine/functional.py similarity index 97% rename from keras/engine/functional.py rename to tf_keras/engine/functional.py index 27f5b9288..d3ca6874a 100644 --- a/keras/engine/functional.py +++ b/tf_keras/engine/functional.py @@ -22,24 +22,24 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.dtensor import layout_map as layout_map_lib -from keras.engine import base_layer -from keras.engine import base_layer_utils -from keras.engine import functional_utils -from keras.engine import input_layer as input_layer_module -from keras.engine import input_spec -from keras.engine import node as node_module -from keras.engine import training as training_lib -from keras.engine import training_utils -from keras.saving import serialization_lib -from keras.saving.legacy import serialization -from keras.saving.legacy.saved_model import json_utils -from keras.saving.legacy.saved_model import network_serialization -from keras.saving.legacy.saved_model import utils as saved_model_utils -from keras.utils import generic_utils -from keras.utils import tf_inspect -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.dtensor import layout_map as layout_map_lib +from tf_keras.engine import base_layer +from tf_keras.engine import base_layer_utils +from tf_keras.engine import functional_utils +from tf_keras.engine import input_layer as input_layer_module +from tf_keras.engine import input_spec +from tf_keras.engine import node as node_module +from tf_keras.engine import training as training_lib +from tf_keras.engine import training_utils +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy import serialization +from tf_keras.saving.legacy.saved_model import json_utils +from tf_keras.saving.legacy.saved_model import network_serialization +from tf_keras.saving.legacy.saved_model import utils as saved_model_utils +from tf_keras.utils import generic_utils +from tf_keras.utils import tf_inspect +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -51,7 +51,7 @@ class Functional(training_lib.Model): Three types of `Model` exist: subclassed `Model`, `Functional` model, and `Sequential` (a special case of `Functional`). - In general, more Keras features are supported with `Functional` + In general, more TF-Keras features are supported with `Functional` than with subclassed `Model`s, specifically: - Model cloning (`keras.models.clone`) @@ -881,7 +881,7 @@ def _validate_graph_inputs_and_outputs(self): def _insert_layers(self, layers, relevant_nodes=None): """Inserts Layers into the Network after Network creation. - This is only valid for Keras Graph Networks. Layers added via this + This is only valid for TF-Keras Graph Networks. Layers added via this function will be included in the `call` computation and `get_config` of this Network. They will not be added to the Network's outputs. @@ -1341,10 +1341,10 @@ def get_node_index(layer, config_node_index): return node_index_map.get((layer.name, config_node_index), None) def _deserialize_keras_tensors(kwargs, layer_map): - """Deserializes Keras Tensors passed to `call`..""" + """Deserializes TF-Keras Tensors passed to `call`..""" def _deserialize_keras_tensor(t): - """Deserializes a single Keras Tensor passed to `call`.""" + """Deserializes a single TF-Keras Tensor passed to `call`.""" if isinstance(t, tf_utils.ListWrapper): t = t.as_list() layer_name = t[0] @@ -1415,7 +1415,7 @@ def process_node(layer, node_data): tf.nest.flatten(inbound_node.outputs)[inbound_tensor_index] ) else: - # We received a constant w/ no Keras history attached, + # We received a constant w/ no TF-Keras history attached, # which means it is a constant tensor input. # Input is a constant value. # Format = [_CONSTANT_VALUE, -1, const_val, kwargs] @@ -1469,7 +1469,7 @@ def process_layer(layer_data): layer = created_layers[layer_name] else: # Instantiate layer. - from keras.layers import deserialize as deserialize_layer + from tf_keras.layers import deserialize as deserialize_layer layer = deserialize_layer(layer_data, custom_objects=custom_objects) created_layers[layer_name] = layer @@ -1559,7 +1559,7 @@ def get_network_config(network, serialize_layer_fn=None, config=None): config = config or {} serialize_obj_fn = serialization_lib.serialize_keras_object set_layers_legacy = False - # To be removed after full affected g3 user migration to Keras V3 Saving. + # To be removed after full affected g3 user migration to TF-Keras V3 Saving. if getattr(network, "use_legacy_config", False): serialize_obj_fn = serialization.serialize_keras_object set_layers_legacy = True @@ -1610,7 +1610,7 @@ def get_network_config(network, serialize_layer_fn=None, config=None): model_inputs = tf.nest.pack_sequence_as( network._nested_inputs, model_inputs ) - # Preserve external Keras compat for Models with single input. + # Preserve external TF-Keras compat for Models with single input. if not tf.nest.is_nested(model_inputs): model_inputs = [model_inputs] model_inputs = tf_utils.convert_inner_node_data(model_inputs) @@ -1629,7 +1629,7 @@ def get_network_config(network, serialize_layer_fn=None, config=None): model_outputs = tf.nest.pack_sequence_as( network._nested_outputs, model_outputs ) - # Preserve external Keras compat for Models with single output. + # Preserve external TF-Keras compat for Models with single output. if not tf.nest.is_nested(model_outputs): model_outputs = [model_outputs] model_outputs = tf_utils.convert_inner_node_data(model_outputs) diff --git a/keras/engine/functional_test.py b/tf_keras/engine/functional_test.py similarity index 99% rename from keras/engine/functional_test.py rename to tf_keras/engine/functional_test.py index 302eae9d8..b98e61fa6 100644 --- a/keras/engine/functional_test.py +++ b/tf_keras/engine/functional_test.py @@ -19,21 +19,21 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import layers -from keras import losses -from keras import models -from keras.engine import base_layer -from keras.engine import functional -from keras.engine import input_layer as input_layer_lib -from keras.engine import sequential -from keras.engine import training as training_lib -from keras.saving import object_registration -from keras.saving.legacy import save -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import layer_utils -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras import layers +from tf_keras import losses +from tf_keras import models +from tf_keras.engine import base_layer +from tf_keras.engine import functional +from tf_keras.engine import input_layer as input_layer_lib +from tf_keras.engine import sequential +from tf_keras.engine import training as training_lib +from tf_keras.saving import object_registration +from tf_keras.saving.legacy import save +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import layer_utils +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.checkpoint.checkpoint import ( @@ -895,7 +895,7 @@ def test_layer_sharing_at_heterogenous_depth_with_concat(self): self.assertAllClose(output_val, output_val_2, atol=1e-6) def test_layer_sharing_maintains_node_order(self): - # See https://github.com/keras-team/keras/issues/14838. + # See https://github.com/keras-team/tf-keras/issues/14838. inp = input_layer_lib.Input(shape=[5], name="main_input") shared_layer = layers.Layer(name="shared") @@ -1230,13 +1230,13 @@ def call(self, x1, x2=None): @test_combinations.generate(test_combinations.keras_mode_combinations()) def test_dont_cast_composite_unless_necessary(self): if not tf.executing_eagerly(): - # Creating Keras inputs from a type_spec only supported in eager. + # Creating TF-Keras inputs from a type_spec only supported in eager. return # TODO(edloper): Change this to tf.experimental.ExtensionTyep once # it's been released. class MyType(extension_type.ExtensionType): - # TODO(edloper) Remove _shape and _dtype once Keras has been + # TODO(edloper) Remove _shape and _dtype once TF-Keras has been # switched to use .shape and .dtype instead. value: tf.Tensor _shape = property(lambda self: self.value.shape) diff --git a/keras/engine/functional_utils.py b/tf_keras/engine/functional_utils.py similarity index 98% rename from keras/engine/functional_utils.py rename to tf_keras/engine/functional_utils.py index bfc4acc41..51fb67907 100644 --- a/keras/engine/functional_utils.py +++ b/tf_keras/engine/functional_utils.py @@ -16,10 +16,10 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import input_layer as input_layer_module -from keras.engine import keras_tensor -from keras.engine import node as node_module +from tf_keras import backend +from tf_keras.engine import input_layer as input_layer_module +from tf_keras.engine import keras_tensor +from tf_keras.engine import node as node_module _KERAS_TENSOR_TYPE_CHECK_ERROR_MSG = ( "Found unexpected instance while processing input tensors for keras " diff --git a/keras/engine/functional_utils_test.py b/tf_keras/engine/functional_utils_test.py similarity index 97% rename from keras/engine/functional_utils_test.py rename to tf_keras/engine/functional_utils_test.py index 3d5be79a1..663041fd6 100644 --- a/keras/engine/functional_utils_test.py +++ b/tf_keras/engine/functional_utils_test.py @@ -20,11 +20,11 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import layers -from keras import models -from keras.engine import functional_utils -from keras.engine import input_layer as input_layer_lib -from keras.testing_infra import test_combinations +from tf_keras import layers +from tf_keras import models +from tf_keras.engine import functional_utils +from tf_keras.engine import input_layer as input_layer_lib +from tf_keras.testing_infra import test_combinations @test_combinations.run_all_keras_modes(always_skip_v1=True) diff --git a/keras/engine/input_layer.py b/tf_keras/engine/input_layer.py similarity index 93% rename from keras/engine/input_layer.py rename to tf_keras/engine/input_layer.py index b4f57818f..39a08550a 100644 --- a/keras/engine/input_layer.py +++ b/tf_keras/engine/input_layer.py @@ -17,15 +17,15 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.distribute import distributed_training_utils -from keras.engine import base_layer -from keras.engine import keras_tensor -from keras.engine import node as node_module -from keras.saving import serialization_lib -from keras.saving.legacy.saved_model import layer_serialization -from keras.utils import tf_utils -from keras.utils import traceback_utils +from tf_keras import backend +from tf_keras.distribute import distributed_training_utils +from tf_keras.engine import base_layer +from tf_keras.engine import keras_tensor +from tf_keras.engine import node as node_module +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy.saved_model import layer_serialization +from tf_keras.utils import tf_utils +from tf_keras.utils import traceback_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -48,10 +48,10 @@ class InputLayer(base_layer.Layer): or create a placeholder tensor (pass arguments `input_shape`, and optionally, `dtype`). - It is generally recommend to use the Keras Functional model via `Input`, + It is generally recommend to use the TF-Keras Functional model via `Input`, (which creates an `InputLayer`) without directly using `InputLayer`. - When using `InputLayer` with the Keras Sequential model, it can be skipped + When using `InputLayer` with the TF-Keras Sequential model, it can be skipped by moving the `input_shape` parameter to the first layer after the `InputLayer`. @@ -70,7 +70,7 @@ class InputLayer(base_layer.Layer): np.ones((10, 8))) # Without InputLayer and let the first layer to have the input_shape. - # Keras will add a input for the model behind the scene. + # TF-Keras will add a input for the model behind the scene. model = tf.keras.Sequential([ tf.keras.layers.Dense(8, input_shape=(4,))]) model.compile(tf.keras.optimizers.RMSprop(0.001), loss='mse') @@ -156,7 +156,7 @@ def __init__( if sparse and ragged: raise ValueError( - "Cannot set both sparse and ragged to True in a Keras input." + "Cannot set both sparse and ragged to True in a TF-Keras input." ) if not name: @@ -199,7 +199,7 @@ def __init__( _assert_other_arg_none(arg_name, arg) if not tf.compat.v1.executing_eagerly_outside_functions(): raise ValueError( - "Creating Keras inputs from a type_spec is only " + "Creating TF-Keras inputs from a type_spec is only " "supported when eager execution is enabled." ) # Needed for type_spec deserialization since TypeSpec objects @@ -305,13 +305,13 @@ def Input( type_spec=None, **kwargs, ): - """`Input()` is used to instantiate a Keras tensor. + """`Input()` is used to instantiate a TF-Keras tensor. - A Keras tensor is a symbolic tensor-like object, which we augment with - certain attributes that allow us to build a Keras model just by knowing the + A TF-Keras tensor is a symbolic tensor-like object, which we augment with + certain attributes that allow us to build a TF-Keras model just by knowing the inputs and outputs of the model. - For instance, if `a`, `b` and `c` are Keras tensors, + For instance, if `a`, `b` and `c` are TF-Keras tensors, it becomes possible to do: `model = Model(input=[a, b], output=c)` @@ -372,9 +372,9 @@ def Input( However, the resulting model will not track any variables that were used as inputs to TensorFlow ops. All variable usages must happen within - Keras layers to make sure they will be tracked by the model's weights. + TF-Keras layers to make sure they will be tracked by the model's weights. - The Keras Input can also create a placeholder from an arbitrary + The TF-Keras Input can also create a placeholder from an arbitrary `tf.TypeSpec`, e.g: ```python diff --git a/keras/engine/input_layer_test.py b/tf_keras/engine/input_layer_test.py similarity index 94% rename from keras/engine/input_layer_test.py rename to tf_keras/engine/input_layer_test.py index 636d6aa4f..ddb139ccf 100644 --- a/keras/engine/input_layer_test.py +++ b/tf_keras/engine/input_layer_test.py @@ -17,17 +17,17 @@ import tensorflow.compat.v2 as tf -from keras import Sequential -from keras import backend -from keras import models -from keras.engine import functional -from keras.engine import input_layer as input_layer_lib -from keras.layers import Dense -from keras.layers import core -from keras.saving.legacy import model_config -from keras.saving.serialization_lib import SafeModeScope -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras import Sequential +from tf_keras import backend +from tf_keras import models +from tf_keras.engine import functional +from tf_keras.engine import input_layer as input_layer_lib +from tf_keras.layers import Dense +from tf_keras.layers import core +from tf_keras.saving.legacy import model_config +from tf_keras.saving.serialization_lib import SafeModeScope +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.framework import type_spec @@ -143,7 +143,7 @@ class InputLayerTest(test_combinations.TestCase): test_combinations.combine(mode=["graph", "eager"]) ) def testBasicOutputShapeNoBatchSize(self): - # Create a Keras Input + # Create a TF-Keras Input x = input_layer_lib.Input(shape=(32,), name="input_a") self.assertAllEqual(x.shape.as_list(), [None, 32]) @@ -155,7 +155,7 @@ def testBasicOutputShapeNoBatchSize(self): test_combinations.combine(mode=["graph", "eager"]) ) def testBasicOutputShapeWithBatchSize(self): - # Create a Keras Input + # Create a TF-Keras Input x = input_layer_lib.Input(batch_size=6, shape=(32,), name="input_b") self.assertAllEqual(x.shape.as_list(), [6, 32]) @@ -171,7 +171,7 @@ def testBasicOutputShapeNoBatchSizeInTFFunction(self): def run_model(inp): nonlocal model if not model: - # Create a Keras Input + # Create a TF-Keras Input x = input_layer_lib.Input(shape=(8,), name="input_a") self.assertAllEqual(x.shape.as_list(), [None, 8]) @@ -193,7 +193,7 @@ def testBasicOutputShapeWithBatchSizeAndNoneDimensionsPlaceholder(self): test_combinations.combine(mode=["graph", "eager"]) ) def testInputTensorArg(self): - # Create a Keras Input + # Create a TF-Keras Input x = input_layer_lib.Input(tensor=tf.zeros((7, 32))) self.assertAllEqual(x.shape.as_list(), [7, 32]) @@ -210,7 +210,7 @@ def testInputTensorArgInTFFunction(self): @tf.function def run_model(inp): if not model_container: - # Create a Keras Input + # Create a TF-Keras Input x = input_layer_lib.Input(tensor=tf.zeros((10, 16))) self.assertAllEqual(x.shape.as_list(), [10, 16]) @@ -224,7 +224,7 @@ def run_model(inp): @test_combinations.generate(test_combinations.combine(mode=["eager"])) def testCompositeInputTensorArg(self): - # Create a Keras Input + # Create a TF-Keras Input rt = tf.RaggedTensor.from_row_splits( values=[3, 1, 4, 1, 5, 9, 2, 6], row_splits=[0, 4, 4, 7, 8, 8] ) @@ -248,7 +248,7 @@ def testCompositeInputTensorArgInTFFunction(self): @tf.function def run_model(inp): if not model_container: - # Create a Keras Input + # Create a TF-Keras Input rt = tf.RaggedTensor.from_row_splits( values=[3, 1, 4, 1, 5, 9, 2, 6], row_splits=[0, 4, 4, 7, 8, 8], @@ -300,7 +300,7 @@ def testNoMixingArgsWithTypeSpecArg(self): @test_combinations.generate(test_combinations.combine(mode=["eager"])) def testTypeSpecArg(self): - # Create a Keras Input + # Create a TF-Keras Input x = input_layer_lib.Input(type_spec=tf.TensorSpec((7, 32), tf.float32)) self.assertAllEqual(x.shape.as_list(), [7, 32]) @@ -324,7 +324,7 @@ def testTypeSpecArgInTFFunction(self): @tf.function def run_model(inp): if not model_container: - # Create a Keras Input + # Create a TF-Keras Input x = input_layer_lib.Input( type_spec=tf.TensorSpec((10, 16), tf.float32) ) @@ -340,7 +340,7 @@ def run_model(inp): @test_combinations.generate(test_combinations.combine(mode=["eager"])) def testCompositeTypeSpecArg(self): - # Create a Keras Input + # Create a TF-Keras Input rt = tf.RaggedTensor.from_row_splits( values=[3, 1, 4, 1, 5, 9, 2, 6], row_splits=[0, 4, 4, 7, 8, 8] ) @@ -370,7 +370,7 @@ def testCompositeTypeSpecArgInTFFunction(self): @tf.function def run_model(inp): if not model_container: - # Create a Keras Input + # Create a TF-Keras Input rt = tf.RaggedTensor.from_row_splits( values=[3, 1, 4, 1, 5, 9, 2, 6], row_splits=[0, 4, 4, 7, 8, 8], @@ -390,7 +390,7 @@ def run_model(inp): @test_combinations.generate(test_combinations.combine(mode=["eager"])) def testCompositeTypeSpecArgWithoutDtype(self): for assign_variant_dtype in [False, True]: - # Create a Keras Input + # Create a TF-Keras Input spec = TwoTensorsSpecNoOneDtype( (1, 2, 3), tf.float32, diff --git a/keras/engine/input_spec.py b/tf_keras/engine/input_spec.py similarity index 99% rename from keras/engine/input_spec.py rename to tf_keras/engine/input_spec.py index 1e18c83cd..ccab9165d 100644 --- a/keras/engine/input_spec.py +++ b/tf_keras/engine/input_spec.py @@ -18,7 +18,7 @@ import tensorflow.compat.v2 as tf -from keras import backend +from tf_keras import backend # isort: off from tensorflow.python.util.tf_export import keras_export @@ -308,7 +308,7 @@ def display_shape(shape): def to_tensor_spec(input_spec, default_dtype=None): - """Converts a Keras InputSpec object to a TensorSpec.""" + """Converts a TF-Keras InputSpec object to a TensorSpec.""" default_dtype = default_dtype or backend.floatx() if isinstance(input_spec, InputSpec): dtype = input_spec.dtype or default_dtype diff --git a/keras/engine/input_spec_test.py b/tf_keras/engine/input_spec_test.py similarity index 98% rename from keras/engine/input_spec_test.py rename to tf_keras/engine/input_spec_test.py index 95f295ff5..221754d54 100644 --- a/keras/engine/input_spec_test.py +++ b/tf_keras/engine/input_spec_test.py @@ -20,7 +20,7 @@ import tensorflow.compat.v2 as tf -from keras.engine import input_spec +from tf_keras.engine import input_spec class InputSpecTest(tf.test.TestCase): diff --git a/keras/engine/keras_tensor.py b/tf_keras/engine/keras_tensor.py similarity index 95% rename from keras/engine/keras_tensor.py rename to tf_keras/engine/keras_tensor.py index cc04cc26c..6dbb634f1 100644 --- a/keras/engine/keras_tensor.py +++ b/tf_keras/engine/keras_tensor.py @@ -16,10 +16,10 @@ import tensorflow.compat.v2 as tf -from keras.utils import object_identity +from tf_keras.utils import object_identity # isort: off -from tensorflow.python.data.util import structure +from tensorflow.python.framework import none_tensor from tensorflow.python.util.tf_export import keras_export @@ -32,10 +32,10 @@ @keras_export("keras.__internal__.KerasTensor", v1=[]) class KerasTensor: - """A representation of a Keras in/output during Functional API construction. + """A representation of a TF-Keras in/output during Functional API construction. `KerasTensor`s are tensor-like objects that represent the symbolic inputs - and outputs of Keras layers during Functional model construction. They are + and outputs of TF-Keras layers during Functional model construction. They are comprised of the `tf.TypeSpec` of the (Composite)Tensor that will be consumed/produced in the corresponding location of the Functional model. @@ -51,7 +51,7 @@ class KerasTensor: infer the output signature and return `KerasTensor`s with `tf.TypeSpec`s corresponding to the symbolic outputs of that layer call. These output `KerasTensor`s will have all of the internal KerasHistory metadata attached - to them that Keras needs to construct a Functional Model. + to them that TF-Keras needs to construct a Functional Model. Currently, layers infer the output signature by: * creating a scratch `FuncGraph` @@ -79,7 +79,7 @@ class KerasTensor: **Automatically converting TF APIs to layers**: If you passing a `KerasTensor` to a TF API that supports dispatching, - Keras will automatically turn that API call into a lambda + TF-Keras will automatically turn that API call into a lambda layer in the Functional model, and return KerasTensors representing the symbolic outputs. @@ -123,7 +123,7 @@ def __init__(self, type_spec, inferred_value=None, name=None): self._inferred_value = inferred_value self._name = name - if not isinstance(type_spec, structure.NoneTensorSpec): + if not isinstance(type_spec, none_tensor.NoneTensorSpec): if not hasattr(type_spec, "shape"): raise ValueError( "KerasTensor only supports TypeSpecs that have a shape " @@ -140,12 +140,12 @@ def __init__(self, type_spec, inferred_value=None, name=None): @property def type_spec(self): - """Returns the `tf.TypeSpec` symbolically inferred for Keras output.""" + """Returns the `tf.TypeSpec` symbolically inferred for TF-Keras output.""" return self._type_spec @property def shape(self): - """Returns the `TensorShape` symbolically inferred for Keras output.""" + """Returns the `TensorShape` symbolically inferred for TF-Keras output.""" return self._type_spec.shape @classmethod @@ -246,9 +246,9 @@ def __len__(self): raise TypeError( "Keras symbolic inputs/outputs do not " "implement `__len__`. You may be " - "trying to pass Keras symbolic inputs/outputs " + "trying to pass TF-Keras symbolic inputs/outputs " "to a TF API that does not register dispatching, " - "preventing Keras from automatically " + "preventing TF-Keras from automatically " "converting the API call to a lambda layer " "in the Functional Model. This error will also get raised " "if you try asserting a symbolic input/output directly." @@ -259,9 +259,9 @@ def op(self): raise TypeError( "Keras symbolic inputs/outputs do not " "implement `op`. You may be " - "trying to pass Keras symbolic inputs/outputs " + "trying to pass TF-Keras symbolic inputs/outputs " "to a TF API that does not register dispatching, " - "preventing Keras from automatically " + "preventing TF-Keras from automatically " "converting the API call to a lambda layer " "in the Functional Model." ) @@ -283,15 +283,15 @@ def __hash__(self): def __array__(self, dtype=None): raise TypeError( - f"You are passing {self}, an intermediate Keras symbolic " + f"You are passing {self}, an intermediate TF-Keras symbolic " "input/output, to a TF API that does not allow registering custom " "dispatchers, such as `tf.cond`, `tf.function`, gradient tapes, " - "or `tf.map_fn`. Keras Functional model construction only supports " + "or `tf.map_fn`. TF-Keras Functional model construction only supports " "TF API calls that *do* support dispatching, such as `tf.math.add` " "or `tf.reshape`. " "Other APIs cannot be called directly on symbolic Keras" "inputs/outputs. You can work around " - "this limitation by putting the operation in a custom Keras layer " + "this limitation by putting the operation in a custom TF-Keras layer " "`call` and calling that layer " "on this symbolic input/output." ) @@ -356,7 +356,7 @@ def __repr__(self): @property def dtype(self): - """Returns the `dtype` symbolically inferred for this Keras output.""" + """Returns the `dtype` symbolically inferred for this TF-Keras output.""" type_spec = self._type_spec if not hasattr(type_spec, "dtype"): raise AttributeError( @@ -388,7 +388,7 @@ def ref(self): def node(self): """Find the corresponding `Node` that produce this keras_tensor. - During functional model construction, Keras will attach `KerasHistory` + During functional model construction, TF-Keras will attach `KerasHistory` to keras tensor to track the connectivity between calls of layers. Return None if there isn't any KerasHistory attached to this tensor. """ diff --git a/keras/engine/keras_tensor_test.py b/tf_keras/engine/keras_tensor_test.py similarity index 98% rename from keras/engine/keras_tensor_test.py rename to tf_keras/engine/keras_tensor_test.py index 6f08689c7..6b3f96f34 100644 --- a/keras/engine/keras_tensor_test.py +++ b/tf_keras/engine/keras_tensor_test.py @@ -18,11 +18,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import layers -from keras.engine import keras_tensor -from keras.engine import training -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras import layers +from tf_keras.engine import keras_tensor +from tf_keras.engine import training +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class CustomTypeSpec(tf.TypeSpec): diff --git a/keras/engine/node.py b/tf_keras/engine/node.py similarity index 96% rename from keras/engine/node.py rename to tf_keras/engine/node.py index 946b9fce3..417e79260 100644 --- a/keras/engine/node.py +++ b/tf_keras/engine/node.py @@ -23,10 +23,10 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer_utils -from keras.saving.legacy.saved_model import json_utils -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine import base_layer_utils +from tf_keras.saving.legacy.saved_model import json_utils +from tf_keras.utils import tf_utils _CONSTANT_VALUE = "_CONSTANT_VALUE" # Using dict to avoid conflict with constant string tensor. @@ -166,7 +166,7 @@ def iterate_inbound(self): yield layer, node_index, tensor_index, kt def map_arguments(self, tensor_dict): - """Maps Keras Tensors to computed Tensors using `tensor_dict`.""" + """Maps TF-Keras Tensors to computed Tensors using `tensor_dict`.""" if self._single_positional_tensor_passed: # Performance optimization for most common case. kt_id, _ = self._keras_inputs_ids_and_indices[0] @@ -315,13 +315,13 @@ class KerasHistory( "KerasHistory", ["layer", "node_index", "tensor_index"] ) ): - """Tracks the Layer call that created a Tensor, for Keras Graph Networks. + """Tracks the Layer call that created a Tensor, for TF-Keras Graph Networks. - During construction of Keras Graph Networks, this metadata is added to + During construction of TF-Keras Graph Networks, this metadata is added to each Tensor produced as the output of a Layer, starting with an - `InputLayer`. This allows Keras to track how each Tensor was produced, and + `InputLayer`. This allows TF-Keras to track how each Tensor was produced, and this information is later retraced by the `keras.engine.Network` class to - reconstruct the Keras Graph Network. + reconstruct the TF-Keras Graph Network. Attributes: layer: The Layer that produced the Tensor. diff --git a/keras/engine/node_test.py b/tf_keras/engine/node_test.py similarity index 97% rename from keras/engine/node_test.py rename to tf_keras/engine/node_test.py index 5fa822e30..73f6fe5f6 100644 --- a/keras/engine/node_test.py +++ b/tf_keras/engine/node_test.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -from keras.engine import base_layer -from keras.engine import node as node_module -from keras.testing_infra import test_combinations +from tf_keras.engine import base_layer +from tf_keras.engine import node as node_module +from tf_keras.testing_infra import test_combinations class DummyTensor(tf.__internal__.types.Tensor): diff --git a/keras/engine/partial_batch_padding_handler.py b/tf_keras/engine/partial_batch_padding_handler.py similarity index 99% rename from keras/engine/partial_batch_padding_handler.py rename to tf_keras/engine/partial_batch_padding_handler.py index a67fa70de..cea6a03d5 100644 --- a/keras/engine/partial_batch_padding_handler.py +++ b/tf_keras/engine/partial_batch_padding_handler.py @@ -17,7 +17,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend +from tf_keras import backend class PartialBatchPaddingHandler: diff --git a/keras/engine/ragged_keras_tensor_test.py b/tf_keras/engine/ragged_keras_tensor_test.py similarity index 98% rename from keras/engine/ragged_keras_tensor_test.py rename to tf_keras/engine/ragged_keras_tensor_test.py index cad4e02e2..5776d8c6d 100644 --- a/keras/engine/ragged_keras_tensor_test.py +++ b/tf_keras/engine/ragged_keras_tensor_test.py @@ -18,10 +18,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import layers -from keras.engine import training -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras import layers +from tf_keras.engine import training +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_utils.run_v2_only diff --git a/keras/engine/saving.py b/tf_keras/engine/saving.py similarity index 94% rename from keras/engine/saving.py rename to tf_keras/engine/saving.py index f72fe1c22..b707767ea 100644 --- a/keras/engine/saving.py +++ b/tf_keras/engine/saving.py @@ -18,4 +18,4 @@ Everything has been moved to keras/saving/. This file will be deleted soon. """ -from keras.saving import * # noqa: F401,F403 +from tf_keras.saving import * # noqa: F401,F403 diff --git a/keras/engine/sequential.py b/tf_keras/engine/sequential.py similarity index 96% rename from keras/engine/sequential.py rename to tf_keras/engine/sequential.py index 137926b97..3bcd0a8ba 100644 --- a/keras/engine/sequential.py +++ b/tf_keras/engine/sequential.py @@ -19,20 +19,20 @@ import tensorflow.compat.v2 as tf -from keras import layers as layer_module -from keras.engine import base_layer -from keras.engine import functional -from keras.engine import input_layer -from keras.engine import training -from keras.engine import training_utils -from keras.saving import serialization_lib -from keras.saving.legacy import serialization as legacy_serialization -from keras.saving.legacy.saved_model import model_serialization -from keras.utils import generic_utils -from keras.utils import layer_utils -from keras.utils import tf_inspect -from keras.utils import tf_utils -from keras.utils import traceback_utils +from tf_keras import layers as layer_module +from tf_keras.engine import base_layer +from tf_keras.engine import functional +from tf_keras.engine import input_layer +from tf_keras.engine import training +from tf_keras.engine import training_utils +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy import serialization as legacy_serialization +from tf_keras.saving.legacy.saved_model import model_serialization +from tf_keras.utils import generic_utils +from tf_keras.utils import layer_utils +from tf_keras.utils import tf_inspect +from tf_keras.utils import tf_utils +from tf_keras.utils import traceback_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -162,7 +162,7 @@ def add(self, layer): multiple output tensors, or is already connected somewhere else (forbidden in `Sequential` models). """ - # If we are passed a Keras tensor created by keras.Input(), we can + # If we are passed a TF-Keras tensor created by keras.Input(), we can # extract the input layer from its keras history and use that without # any loss of # generality. @@ -349,7 +349,7 @@ def _build_graph_network_for_inferred_shape( self._created_nodes = created_nodes try: # Initialize a graph Network. This call will never fail - # for a stack of valid Keras layers. However some users + # for a stack of valid TF-Keras layers. However some users # have layers that are fundamentally incompatible with # the Functional API, which do not return tensors. In # this case, we fall back to the legacy deferred diff --git a/keras/engine/sequential_test.py b/tf_keras/engine/sequential_test.py similarity index 99% rename from keras/engine/sequential_test.py rename to tf_keras/engine/sequential_test.py index 54097e71b..1df11ddd6 100644 --- a/keras/engine/sequential_test.py +++ b/tf_keras/engine/sequential_test.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/engine/training.py b/tf_keras/engine/training.py similarity index 98% rename from keras/engine/training.py rename to tf_keras/engine/training.py index f8b2dbcfa..2692cbb2e 100644 --- a/keras/engine/training.py +++ b/tf_keras/engine/training.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Training-related part of the Keras engine.""" +"""Training-related part of the TF-Keras engine.""" import copy import itertools @@ -29,37 +29,37 @@ from tensorflow.python.util.tf_export import keras_export from tensorflow.tools.docs import doc_controls -from keras import backend -from keras import callbacks as callbacks_module -from keras import optimizers -from keras.dtensor import dtensor_api -from keras.dtensor import layout_map as layout_map_lib -from keras.engine import base_layer -from keras.engine import base_layer_utils -from keras.engine import compile_utils -from keras.engine import data_adapter -from keras.engine import input_layer as input_layer_module -from keras.engine import training_utils -from keras.metrics import base_metric -from keras.mixed_precision import loss_scale_optimizer as lso -from keras.optimizers import optimizer -from keras.optimizers import optimizer_v1 -from keras.saving import pickle_utils -from keras.saving import saving_api -from keras.saving import saving_lib -from keras.saving import serialization_lib -from keras.saving.legacy import serialization -from keras.saving.legacy.saved_model import json_utils -from keras.saving.legacy.saved_model import model_serialization -from keras.utils import generic_utils -from keras.utils import io_utils -from keras.utils import layer_utils -from keras.utils import steps_per_execution_tuning -from keras.utils import tf_inspect -from keras.utils import tf_utils -from keras.utils import traceback_utils -from keras.utils import version_utils -from keras.utils.mode_keys import ModeKeys +from tf_keras import backend +from tf_keras import callbacks as callbacks_module +from tf_keras import optimizers +from tf_keras.dtensor import dtensor_api +from tf_keras.dtensor import layout_map as layout_map_lib +from tf_keras.engine import base_layer +from tf_keras.engine import base_layer_utils +from tf_keras.engine import compile_utils +from tf_keras.engine import data_adapter +from tf_keras.engine import input_layer as input_layer_module +from tf_keras.engine import training_utils +from tf_keras.metrics import base_metric +from tf_keras.mixed_precision import loss_scale_optimizer as lso +from tf_keras.optimizers import optimizer +from tf_keras.optimizers import optimizer_v1 +from tf_keras.saving import pickle_utils +from tf_keras.saving import saving_api +from tf_keras.saving import saving_lib +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy import serialization +from tf_keras.saving.legacy.saved_model import json_utils +from tf_keras.saving.legacy.saved_model import model_serialization +from tf_keras.utils import generic_utils +from tf_keras.utils import io_utils +from tf_keras.utils import layer_utils +from tf_keras.utils import steps_per_execution_tuning +from tf_keras.utils import tf_inspect +from tf_keras.utils import tf_utils +from tf_keras.utils import traceback_utils +from tf_keras.utils import version_utils +from tf_keras.utils.mode_keys import ModeKeys try: import h5py @@ -192,7 +192,7 @@ def __new__(cls, *args, **kwargs): # Signature detection if is_functional_model_init_params(args, kwargs) and cls == Model: # Functional model - from keras.engine import functional + from tf_keras.engine import functional return functional.Functional(skip_init=True, *args, **kwargs) else: @@ -207,7 +207,7 @@ def __init__(self, *args, **kwargs): # Special case for Subclassed Functional Model, which we couldn't detect # when __new__ is called. We only realize it is a functional model when # it calls super.__init__ with input and output tensor. - from keras.engine import functional + from tf_keras.engine import functional if is_functional_model_init_params(args, kwargs) and not isinstance( self, functional.Functional @@ -359,7 +359,7 @@ def _init_batch_counters(self): # `evaluate`, and `predict`. if not tf.inside_function(): # Creating variables inside tf.function is not allowed, hence - # these would otherwise prevent users from creating Keras layers + # these would otherwise prevent users from creating TF-Keras layers # inside tf.function. # These variables are not connected to outputs so they have no # effect on graph generation anyway. @@ -608,7 +608,7 @@ def call(self, inputs, training=None, mask=None): run the `Network` in training mode or inference mode. mask: A mask or list of masks. A mask can be either a boolean tensor or None (no mask). For more details, check the guide - [here](https://www.tensorflow.org/guide/keras/masking_and_padding). + [here](https://www.tensorflow.org/guide/tf_keras/masking_and_padding). Returns: A tensor if there is a single output, or @@ -1124,7 +1124,7 @@ def train_step(self, data): This method can be overridden to support custom training logic. For concrete examples of how to override this method see [Customizing what happens in fit]( - https://www.tensorflow.org/guide/keras/customizing_what_happens_in_fit). + https://www.tensorflow.org/guide/tf_keras/customizing_what_happens_in_fit). This method is called by `Model.make_train_function`. This method should contain the mathematical logic for one step of @@ -1669,14 +1669,14 @@ def fit( A common pattern is to pass a tf.data.Dataset, generator, or tf.keras.utils.Sequence to the `x` argument of fit, which will in fact yield not only features (x) but optionally targets (y) and sample - weights. Keras requires that the output of such iterator-likes be + weights. TF-Keras requires that the output of such iterator-likes be unambiguous. The iterator should return a tuple of length 1, 2, or 3, where the optional second and third elements will be used for y and sample_weight respectively. Any other type provided will be wrapped in a length one tuple, effectively treating everything as 'x'. When yielding dicts, they should still adhere to the top-level tuple structure. - e.g. `({"x0": x0, "x1": x1}, y)`. Keras will not attempt to separate + e.g. `({"x0": x0, "x1": x1}, y)`. TF-Keras will not attempt to separate features, targets, and weights from the keys of a single dict. A notable unsupported data type is the namedtuple. The reason is that it behaves like both an ordered datatype (tuple) and a mapping @@ -2184,7 +2184,7 @@ def evaluate( argument is not supported with array inputs. callbacks: List of `keras.callbacks.Callback` instances. List of callbacks to apply during evaluation. See - [callbacks](https://www.tensorflow.org/api_docs/python/tf/keras/callbacks). + [callbacks](https://www.tensorflow.org/api_docs/python/tf/tf_keras/callbacks). max_queue_size: Integer. Used for generator or `keras.utils.Sequence` input only. Maximum size for the generator queue. If unspecified, `max_queue_size` will default to 10. @@ -2541,7 +2541,7 @@ def predict( callbacks: List of `keras.callbacks.Callback` instances. List of callbacks to apply during prediction. See [callbacks]( - https://www.tensorflow.org/api_docs/python/tf/keras/callbacks). + https://www.tensorflow.org/api_docs/python/tf/tf_keras/callbacks). max_queue_size: Integer. Used for generator or `keras.utils.Sequence` input only. Maximum size for the generator queue. If unspecified, `max_queue_size` will default @@ -3054,15 +3054,15 @@ def save(self, filepath, overwrite=True, save_format=None, **kwargs): https://keras.io/guides/serialization_and_saving/) for details. Args: - model: Keras model instance to be saved. + model: TF-Keras model instance to be saved. filepath: `str` or `pathlib.Path` object. Path where to save the model. overwrite: Whether we should overwrite any existing model at the target location, or instead ask the user via an interactive prompt. - save_format: Either `"keras"`, `"tf"`, `"h5"`, + save_format: Either `"tf_keras"`, `"tf"`, `"h5"`, indicating whether to save the model - in the native Keras format (`.keras`), + in the native TF-Keras format (`.keras`), in the TensorFlow SavedModel format (referred to as "SavedModel" below), or in the legacy HDF5 format (`.h5`). @@ -3244,9 +3244,9 @@ def _updated_config(self): """Util shared between different serialization methods. Returns: - Model config with Keras version information added. + Model config with TF-Keras version information added. """ - from keras import __version__ as keras_version + from tf_keras import __version__ as keras_version config = self.get_config() model_config = { @@ -3303,7 +3303,7 @@ def from_config(cls, config, custom_objects=None): # `Functional`. In the case that `cls` is meant to behave like a child # class of `Functional` but only inherits from the `Model` class, we # have to call `cls(...)` instead of `Functional.from_config`. - from keras.engine import functional + from tf_keras.engine import functional with serialization.SharedObjectLoadingScope(): functional_config_keys = [ @@ -3446,7 +3446,7 @@ def weights(self): """Returns the list of all layer variables/weights. Note: This will not track the weights of nested `tf.Modules` that are - not themselves Keras layers. + not themselves TF-Keras layers. Returns: A list of variables. @@ -3715,7 +3715,7 @@ def export(self, filepath): use the lower-level `keras.export.ExportArchive` class. The `export()` method relies on `ExportArchive` internally. """ - from keras.export import export_lib + from tf_keras.export import export_lib export_lib.export_model(self, filepath) @@ -3948,7 +3948,7 @@ def _maybe_load_initial_counters_from_ckpt( ): """Maybe load initial epoch from ckpt, considering worker recovery. - Refer to tensorflow/python/keras/distribute/worker_training_state.py + Refer to tensorflow/python/tf_keras/distribute/worker_training_state.py for more information. Args: @@ -4445,8 +4445,8 @@ def _method_wrapper(self, *args, **kwargs): def inject_functional_model_class(cls): """Inject `Functional` into the hierarchy of this class if needed.""" - from keras.engine import functional - from keras.engine import training_v1 + from tf_keras.engine import functional + from tf_keras.engine import training_v1 if cls == Model or cls == training_v1.Model: return functional.Functional diff --git a/keras/engine/training_arrays_test.py b/tf_keras/engine/training_arrays_test.py similarity index 97% rename from keras/engine/training_arrays_test.py rename to tf_keras/engine/training_arrays_test.py index cf85bafc3..fd5492c3a 100644 --- a/keras/engine/training_arrays_test.py +++ b/tf_keras/engine/training_arrays_test.py @@ -22,12 +22,12 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.engine import data_adapter -from keras.layers import core -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import io_utils +import tf_keras as keras +from tf_keras.engine import data_adapter +from tf_keras.layers import core +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import io_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/engine/training_arrays_v1.py b/tf_keras/engine/training_arrays_v1.py similarity index 98% rename from keras/engine/training_arrays_v1.py rename to tf_keras/engine/training_arrays_v1.py index a3920e2a1..2420f7cb8 100644 --- a/keras/engine/training_arrays_v1.py +++ b/tf_keras/engine/training_arrays_v1.py @@ -12,21 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Part of the Keras training engine related to plain array data.""" +"""Part of the TF-Keras training engine related to plain array data.""" import functools import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import callbacks as cbks -from keras.distribute import distributed_training_utils_v1 -from keras.engine import training_utils_v1 -from keras.utils import io_utils -from keras.utils.generic_utils import make_batches -from keras.utils.generic_utils import slice_arrays -from keras.utils.mode_keys import ModeKeys +from tf_keras import backend +from tf_keras import callbacks as cbks +from tf_keras.distribute import distributed_training_utils_v1 +from tf_keras.engine import training_utils_v1 +from tf_keras.utils import io_utils +from tf_keras.utils.generic_utils import make_batches +from tf_keras.utils.generic_utils import slice_arrays +from tf_keras.utils.mode_keys import ModeKeys # isort: off from tensorflow.python.platform import tf_logging as logging @@ -64,7 +64,7 @@ def model_iteration( """Loop function for arrays of data with modes TRAIN/TEST/PREDICT. Args: - model: Keras Model instance. + model: TF-Keras Model instance. inputs: Either a list or dictionary of arrays, or a dataset instance. targets: List/dictionary of input arrays. sample_weights: Optional list of sample weight arrays. diff --git a/keras/engine/training_dataset_test.py b/tf_keras/engine/training_dataset_test.py similarity index 98% rename from keras/engine/training_dataset_test.py rename to tf_keras/engine/training_dataset_test.py index 07d5d839c..47899de74 100644 --- a/keras/engine/training_dataset_test.py +++ b/tf_keras/engine/training_dataset_test.py @@ -20,12 +20,12 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras import callbacks -from keras import metrics as metrics_module -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import io_utils +import tf_keras as keras +from tf_keras import callbacks +from tf_keras import metrics as metrics_module +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import io_utils # isort: off from tensorflow.python.platform import tf_logging as logging diff --git a/keras/engine/training_distributed_v1.py b/tf_keras/engine/training_distributed_v1.py similarity index 97% rename from keras/engine/training_distributed_v1.py rename to tf_keras/engine/training_distributed_v1.py index dc600160d..6ecb43c42 100644 --- a/keras/engine/training_distributed_v1.py +++ b/tf_keras/engine/training_distributed_v1.py @@ -12,20 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Part of the Keras training engine related to distributed training.""" +"""Part of the TF-Keras training engine related to distributed training.""" import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import callbacks as cbks -from keras.distribute import distribute_coordinator_utils as dc -from keras.distribute import distributed_training_utils_v1 as dist_utils -from keras.engine import partial_batch_padding_handler as padding_util -from keras.engine import training_arrays_v1 -from keras.engine import training_utils_v1 -from keras.utils.generic_utils import Progbar -from keras.utils.mode_keys import ModeKeys +from tf_keras import backend +from tf_keras import callbacks as cbks +from tf_keras.distribute import distribute_coordinator_utils as dc +from tf_keras.distribute import distributed_training_utils_v1 as dist_utils +from tf_keras.engine import partial_batch_padding_handler as padding_util +from tf_keras.engine import training_arrays_v1 +from tf_keras.engine import training_utils_v1 +from tf_keras.utils.generic_utils import Progbar +from tf_keras.utils.mode_keys import ModeKeys # isort: off from tensorflow.python.distribute import input_lib @@ -57,7 +57,7 @@ def _make_train_step_fn(model, mode, strategy, output_labels): """Create step fn. Args: - model: a Keras Model instance. + model: a TF-Keras Model instance. mode: One of ModeKeys.TRAIN/ModeKeys.TEST/ModeKeys.PREDICT. strategy: a `tf.distribute.Strategy` instance. output_labels: the output labels for the step function. @@ -147,7 +147,7 @@ def experimental_tpu_fit_loop( """Fit loop for training with TPU tf.distribute.Strategy. Args: - model: Keras Model instance. + model: TF-Keras Model instance. dataset: Dataset that returns inputs and targets epochs: Number of times to iterate over the data verbose: Integer, Verbosity mode, 0, 1 or 2 @@ -331,7 +331,7 @@ def experimental_tpu_test_loop( """Test loop for evaluating with TPU tf.distribute.Strategy. Args: - model: Keras Model instance. + model: TF-Keras Model instance. dataset: Dataset for input data. verbose: Integer, Verbosity mode 0 or 1. steps: Total number of steps (batches of samples) @@ -474,7 +474,7 @@ def experimental_tpu_predict_loop( """Predict loop for predicting with TPU tf.distribute.Strategy. Args: - model: Keras Model instance. + model: TF-Keras Model instance. dataset: Dataset for input data. verbose: Integer, Verbosity mode 0 or 1. steps: Total number of steps (batches of samples) diff --git a/keras/engine/training_eager_test.py b/tf_keras/engine/training_eager_test.py similarity index 98% rename from keras/engine/training_eager_test.py rename to tf_keras/engine/training_eager_test.py index 317ca1f79..178586403 100644 --- a/keras/engine/training_eager_test.py +++ b/tf_keras/engine/training_eager_test.py @@ -18,11 +18,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import metrics as metrics_module -from keras.optimizers.legacy import rmsprop -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras import metrics as metrics_module +from tf_keras.optimizers.legacy import rmsprop +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class TrainingTest(test_combinations.TestCase): diff --git a/keras/engine/training_eager_v1.py b/tf_keras/engine/training_eager_v1.py similarity index 98% rename from keras/engine/training_eager_v1.py rename to tf_keras/engine/training_eager_v1.py index 427b816f8..d0f91caf6 100644 --- a/keras/engine/training_eager_v1.py +++ b/tf_keras/engine/training_eager_v1.py @@ -17,11 +17,11 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import training_utils -from keras.engine import training_utils_v1 -from keras.mixed_precision import loss_scale_optimizer -from keras.utils import losses_utils +from tf_keras import backend +from tf_keras.engine import training_utils +from tf_keras.engine import training_utils_v1 +from tf_keras.mixed_precision import loss_scale_optimizer +from tf_keras.utils import losses_utils # isort: off from tensorflow.python.eager.backprop import GradientTape diff --git a/keras/engine/training_generator_test.py b/tf_keras/engine/training_generator_test.py similarity index 97% rename from keras/engine/training_generator_test.py rename to tf_keras/engine/training_generator_test.py index 70c32ca78..31044a5a1 100644 --- a/keras/engine/training_generator_test.py +++ b/tf_keras/engine/training_generator_test.py @@ -20,16 +20,16 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import layers as layers_module -from keras import losses -from keras import metrics as metrics_module -from keras.engine import input_layer -from keras.engine import training -from keras.engine import training_generator_v1 -from keras.optimizers.legacy import rmsprop -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import data_utils +from tf_keras import layers as layers_module +from tf_keras import losses +from tf_keras import metrics as metrics_module +from tf_keras.engine import input_layer +from tf_keras.engine import training +from tf_keras.engine import training_generator_v1 +from tf_keras.optimizers.legacy import rmsprop +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import data_utils def custom_generator(mode=2): diff --git a/keras/engine/training_generator_v1.py b/tf_keras/engine/training_generator_v1.py similarity index 98% rename from keras/engine/training_generator_v1.py rename to tf_keras/engine/training_generator_v1.py index 4b82fad14..bdc65373a 100644 --- a/keras/engine/training_generator_v1.py +++ b/tf_keras/engine/training_generator_v1.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Part of the Keras training engine related to Python generators of array data. +"""Part of the TF-Keras training engine related to Python generators of array data. """ import functools @@ -21,13 +21,13 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import callbacks as cbks -from keras.engine import training_utils -from keras.engine import training_utils_v1 -from keras.utils import data_utils -from keras.utils import generic_utils -from keras.utils.mode_keys import ModeKeys +from tf_keras import backend +from tf_keras import callbacks as cbks +from tf_keras.engine import training_utils +from tf_keras.engine import training_utils_v1 +from tf_keras.utils import data_utils +from tf_keras.utils import generic_utils +from tf_keras.utils.mode_keys import ModeKeys # isort: off from tensorflow.python.platform import tf_logging as logging @@ -57,7 +57,7 @@ def model_iteration( """Loop function for arrays of data with modes TRAIN/TEST/PREDICT. Args: - model: Keras Model instance. + model: TF-Keras Model instance. data: Either a tuple of NumPy/Tensor inputs (i.e. `(x,)` or `(x, y)` or `(x, y, sample_weights)`) or a generator or `keras.utils.data_utils.Sequence` object or Eager Iterator or Dataset. diff --git a/keras/engine/training_gpu_test.py b/tf_keras/engine/training_gpu_test.py similarity index 96% rename from keras/engine/training_gpu_test.py rename to tf_keras/engine/training_gpu_test.py index cfa3eb5b3..7bee7db2d 100644 --- a/keras/engine/training_gpu_test.py +++ b/tf_keras/engine/training_gpu_test.py @@ -18,12 +18,12 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import backend -from keras.engine import input_layer -from keras.engine import training -from keras.layers.convolutional import Conv2D -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras import backend +from tf_keras.engine import input_layer +from tf_keras.engine import training +from tf_keras.layers.convolutional import Conv2D +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class TrainingGPUTest(tf.test.TestCase, parameterized.TestCase): diff --git a/keras/engine/training_integration_test.py b/tf_keras/engine/training_integration_test.py similarity index 98% rename from keras/engine/training_integration_test.py rename to tf_keras/engine/training_integration_test.py index 8b6050c39..eba912cc1 100644 --- a/keras/engine/training_integration_test.py +++ b/tf_keras/engine/training_integration_test.py @@ -21,9 +21,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils def _conv2d_filter(**kwargs): diff --git a/keras/engine/training_test.py b/tf_keras/engine/training_test.py similarity index 99% rename from keras/engine/training_test.py rename to tf_keras/engine/training_test.py index 579367c3c..28a2eed5b 100644 --- a/keras/engine/training_test.py +++ b/tf_keras/engine/training_test.py @@ -24,26 +24,26 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import backend -from keras import layers as layers_module -from keras import losses -from keras import metrics as metrics_module -from keras.callbacks import Callback -from keras.engine import input_layer -from keras.engine import sequential -from keras.engine import training as training_module -from keras.engine import training_utils_v1 -from keras.layers.preprocessing import string_lookup -from keras.mixed_precision import policy -from keras.optimizers import legacy as optimizer_legacy -from keras.optimizers import rmsprop -from keras.optimizers import sgd as sgd_experimental -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import data_utils -from keras.utils import io_utils -from keras.utils import np_utils +import tf_keras as keras +from tf_keras import backend +from tf_keras import layers as layers_module +from tf_keras import losses +from tf_keras import metrics as metrics_module +from tf_keras.callbacks import Callback +from tf_keras.engine import input_layer +from tf_keras.engine import sequential +from tf_keras.engine import training as training_module +from tf_keras.engine import training_utils_v1 +from tf_keras.layers.preprocessing import string_lookup +from tf_keras.mixed_precision import policy +from tf_keras.optimizers import legacy as optimizer_legacy +from tf_keras.optimizers import rmsprop +from tf_keras.optimizers import sgd as sgd_experimental +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import data_utils +from tf_keras.utils import io_utils +from tf_keras.utils import np_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/engine/training_utils.py b/tf_keras/engine/training_utils.py similarity index 99% rename from keras/engine/training_utils.py rename to tf_keras/engine/training_utils.py index 4e2981573..f6de04fb4 100644 --- a/keras/engine/training_utils.py +++ b/tf_keras/engine/training_utils.py @@ -17,7 +17,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.utils import generic_utils +from tf_keras.utils import generic_utils def slice_arrays(arrays, indices, contiguous=True): diff --git a/keras/engine/training_utils_v1.py b/tf_keras/engine/training_utils_v1.py similarity index 99% rename from keras/engine/training_utils_v1.py rename to tf_keras/engine/training_utils_v1.py index 48cfdd4c0..f4c2d39a9 100644 --- a/keras/engine/training_utils_v1.py +++ b/tf_keras/engine/training_utils_v1.py @@ -25,14 +25,14 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import callbacks as cbks -from keras import losses -from keras import metrics as metrics_module -from keras.utils import data_utils -from keras.utils import generic_utils -from keras.utils import losses_utils -from keras.utils import tf_inspect +from tf_keras import backend +from tf_keras import callbacks as cbks +from tf_keras import losses +from tf_keras import metrics as metrics_module +from tf_keras.utils import data_utils +from tf_keras.utils import generic_utils +from tf_keras.utils import losses_utils +from tf_keras.utils import tf_inspect # isort: off from tensorflow.python.platform import tf_logging as logging @@ -511,7 +511,7 @@ def check_num_samples(ins, batch_size=None, steps=None, steps_name="steps"): in which case the number of samples is set to `None`. Args: - ins: List of tensors to be fed to the Keras function. + ins: List of tensors to be fed to the TF-Keras function. batch_size: Integer batch size or `None` if not defined. steps: Total number of steps (batches of samples) before declaring `_predict_loop` finished. Ignored with the default value of `None`. @@ -923,7 +923,7 @@ def check_loss_and_target_compatibility(targets, loss_fns, output_shapes): "If your targets are integer classes, " "you can convert them to the expected format via:\n" "```\n" - "from keras.utils import to_categorical\n" + "from tf_keras.utils import to_categorical\n" "y_binary = to_categorical(y_int)\n" "```\n" "\n" @@ -1886,7 +1886,7 @@ def infer_steps_for_dataset( """Infers steps_per_epoch needed to loop through a dataset. Args: - model: Keras model instance. + model: TF-Keras model instance. dataset: Input data of type tf.data.Dataset. steps: Number of steps to draw from the dataset (may be None if unknown). diff --git a/keras/engine/training_utils_v1_test.py b/tf_keras/engine/training_utils_v1_test.py similarity index 98% rename from keras/engine/training_utils_v1_test.py rename to tf_keras/engine/training_utils_v1_test.py index d4cfb8027..61ac90374 100644 --- a/keras/engine/training_utils_v1_test.py +++ b/tf_keras/engine/training_utils_v1_test.py @@ -22,11 +22,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import backend -from keras.engine import keras_tensor -from keras.engine import training_utils_v1 -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras import backend +from tf_keras.engine import keras_tensor +from tf_keras.engine import training_utils_v1 +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.platform import tf_logging as logging diff --git a/keras/engine/training_v1.py b/tf_keras/engine/training_v1.py similarity index 98% rename from keras/engine/training_v1.py rename to tf_keras/engine/training_v1.py index 3324e1c2b..bd78a98bd 100644 --- a/keras/engine/training_v1.py +++ b/tf_keras/engine/training_v1.py @@ -12,38 +12,38 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""V1 Training-related part of the Keras engine.""" +"""V1 Training-related part of the TF-Keras engine.""" import collections import warnings import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import losses -from keras import metrics as metrics_module -from keras import optimizers -from keras.distribute import distributed_training_utils -from keras.distribute import distributed_training_utils_v1 -from keras.engine import base_layer -from keras.engine import training as training_lib -from keras.engine import training_arrays_v1 -from keras.engine import training_distributed_v1 -from keras.engine import training_eager_v1 -from keras.engine import training_generator_v1 -from keras.engine import training_utils -from keras.engine import training_utils_v1 -from keras.mixed_precision import loss_scale_optimizer -from keras.optimizers import optimizer_v1 -from keras.optimizers.legacy import optimizer_v2 -from keras.saving.legacy import saving_utils -from keras.saving.legacy.saved_model import model_serialization -from keras.utils import data_utils -from keras.utils import layer_utils -from keras.utils import losses_utils -from keras.utils import tf_inspect -from keras.utils import tf_utils -from keras.utils.mode_keys import ModeKeys +from tf_keras import backend +from tf_keras import losses +from tf_keras import metrics as metrics_module +from tf_keras import optimizers +from tf_keras.distribute import distributed_training_utils +from tf_keras.distribute import distributed_training_utils_v1 +from tf_keras.engine import base_layer +from tf_keras.engine import training as training_lib +from tf_keras.engine import training_arrays_v1 +from tf_keras.engine import training_distributed_v1 +from tf_keras.engine import training_eager_v1 +from tf_keras.engine import training_generator_v1 +from tf_keras.engine import training_utils +from tf_keras.engine import training_utils_v1 +from tf_keras.mixed_precision import loss_scale_optimizer +from tf_keras.optimizers import optimizer_v1 +from tf_keras.optimizers.legacy import optimizer_v2 +from tf_keras.saving.legacy import saving_utils +from tf_keras.saving.legacy.saved_model import model_serialization +from tf_keras.utils import data_utils +from tf_keras.utils import layer_utils +from tf_keras.utils import losses_utils +from tf_keras.utils import tf_inspect +from tf_keras.utils import tf_utils +from tf_keras.utils.mode_keys import ModeKeys # isort: off from tensorflow.python.platform import tf_logging as logging @@ -275,10 +275,10 @@ def compile( dictionary or a list of modes. Defaults to `None`. weighted_metrics: List of metrics to be evaluated and weighted by sample_weight or class_weight during training and testing. - target_tensors: By default, Keras will create placeholders for the + target_tensors: By default, TF-Keras will create placeholders for the model's target, which will be fed with the target data during training. If instead you would like to use your own - target tensors (in turn, Keras will not expect external + target tensors (in turn, TF-Keras will not expect external Numpy data for these targets at training time), you can specify them via the `target_tensors` argument. It can be a single tensor (for a single-output model), a list of tensors, @@ -634,7 +634,7 @@ def _select_training_loop(self, inputs): # because we currently have to fall back for unhandled data types. if isinstance(inputs, (tf.compat.v1.data.Iterator, tf.data.Iterator)): raise ValueError( - "For performance reasons Keras `fit`, `evaluate` and" + "For performance reasons TF-Keras `fit`, `evaluate` and" "`predict` accept tf.data `Datasets` as input but not " "iterators that have been manually generated from " "Datasets by users. Please directly pass in the " @@ -940,7 +940,7 @@ def evaluate( This argument is not supported with array inputs. callbacks: List of `keras.callbacks.Callback` instances. List of callbacks to apply during evaluation. - See [callbacks](/api_docs/python/tf/keras/callbacks). + See [callbacks](/api_docs/python/tf/tf_keras/callbacks). max_queue_size: Integer. Used for generator or `keras.utils.Sequence` input only. Maximum size for the generator queue. If unspecified, `max_queue_size` will default @@ -1024,7 +1024,7 @@ def predict( run until the input dataset is exhausted. callbacks: List of `keras.callbacks.Callback` instances. List of callbacks to apply during prediction. - See [callbacks](/api_docs/python/tf/keras/callbacks). + See [callbacks](/api_docs/python/tf/tf_keras/callbacks). max_queue_size: Integer. Used for generator or `keras.utils.Sequence` input only. Maximum size for the generator queue. If unspecified, `max_queue_size` will default @@ -1663,7 +1663,7 @@ def _compile_weights_loss_and_weighted_metrics(self, sample_weights=None): This may be used to set graph tensors as sample weights (instead of creating placeholders). This functionality is necessary for - `tf.keras.estimator.model_to_estimator`, which calls Keras models in a + `tf.keras.estimator.model_to_estimator`, which calls TF-Keras models in a v1 graph, and creates iterator tensors for inputs, targets, and sample weights. @@ -2971,7 +2971,7 @@ def _set_inputs(self, inputs, outputs=None, training=None): provided value will be used. training: Boolean or None. Only relevant in symbolic mode. Specifies whether to build the model's graph in inference mode (False), - training mode (True), or using the Keras learning phase (None). + training mode (True), or using the TF-Keras learning phase (None). Raises: ValueError: If dict inputs are passed to a Sequential Model where the first layer isn't FeatureLayer. @@ -3136,7 +3136,7 @@ def _feed_sample_weights(self): def _maybe_load_initial_epoch_from_ckpt(self, initial_epoch, mode): """Maybe load 1st epoch from checkpoint, considering worker recovery. - Refer to tensorflow/python/keras/distribute/worker_training_state.py + Refer to tensorflow/python/tf_keras/distribute/worker_training_state.py for more information. Args: diff --git a/keras/estimator/BUILD b/tf_keras/estimator/BUILD similarity index 65% rename from keras/estimator/BUILD rename to tf_keras/estimator/BUILD index 6b871702e..57f7e1102 100644 --- a/keras/estimator/BUILD +++ b/tf_keras/estimator/BUILD @@ -1,12 +1,12 @@ # Description: -# Contains Keras models to Estimator converter +# Contains TF-Keras models to Estimator converter # Placeholder: load unaliased py_library package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", ], licenses = ["notice"], ) diff --git a/keras/estimator/__init__.py b/tf_keras/estimator/__init__.py similarity index 90% rename from keras/estimator/__init__.py rename to tf_keras/estimator/__init__.py index 00fa3c96e..e935242a5 100644 --- a/keras/estimator/__init__.py +++ b/tf_keras/estimator/__init__.py @@ -19,12 +19,12 @@ # isort: off from tensorflow.python.util.tf_export import keras_export -# Keras has undeclared dependency on tensorflow/estimator:estimator_py. +# TF-Keras has undeclared dependency on tensorflow/estimator:estimator_py. # As long as you depend //third_party/py/tensorflow:tensorflow target # everything will work as normal. _model_to_estimator_usage_gauge = tf.__internal__.monitoring.BoolGauge( - "/tensorflow/api/keras/model_to_estimator", + "/tensorflow/api/tf_keras/model_to_estimator", "Whether tf.keras.estimator.model_to_estimator() is called.", "version", ) @@ -45,11 +45,11 @@ def model_to_estimator( """Constructs an `Estimator` instance from given keras model. If you use infrastructure or other tooling that relies on Estimators, you - can still build a Keras model and use model_to_estimator to convert the - Keras model to an Estimator for use with downstream systems. + can still build a TF-Keras model and use model_to_estimator to convert the + TF-Keras model to an Estimator for use with downstream systems. For usage example, please see: - [Creating estimators from Keras Models]( + [Creating estimators from TF-Keras Models]( https://www.tensorflow.org/guide/estimator#create_an_estimator_from_a_keras_model). Sample Weights: @@ -97,10 +97,10 @@ def input_fn(): ``` Args: - keras_model: A compiled Keras model object. This argument is mutually + keras_model: A compiled TF-Keras model object. This argument is mutually exclusive with `keras_model_path`. Estimator's `model_fn` uses the structure of the model to clone the model. Defaults to `None`. - keras_model_path: Path to a compiled Keras model saved on disk, in HDF5 + keras_model_path: Path to a compiled TF-Keras model saved on disk, in HDF5 format, which can be generated with the `save()` method of a Keras model. This argument is mutually exclusive with `keras_model`. Defaults to `None`. @@ -121,23 +121,23 @@ def input_fn(): estimator when training. May be `saver` or `checkpoint`, depending on whether to save checkpoints from `tf.train.Saver` or `tf.train.Checkpoint`. Estimators use name-based `tf.train.Saver` - checkpoints, while Keras models use object-based checkpoints from + checkpoints, while TF-Keras models use object-based checkpoints from `tf.train.Checkpoint`. Currently, saving object-based checkpoints from `model_to_estimator` is only supported by Functional and Sequential models. Defaults to 'saver'. - metric_names_map: Optional dictionary mapping Keras model output metric + metric_names_map: Optional dictionary mapping TF-Keras model output metric names to custom names. This can be used to override the default Keras model output metrics names in a multi IO model use case and provide custom names for the `eval_metric_ops` in Estimator. - The Keras model metric names can be obtained using `model.metrics_names` + The TF-Keras model metric names can be obtained using `model.metrics_names` excluding any loss metrics such as total loss and output losses. - For example, if your Keras model has two outputs `out_1` and `out_2`, + For example, if your TF-Keras model has two outputs `out_1` and `out_2`, with `mse` loss and `acc` metric, then `model.metrics_names` will be `['loss', 'out_1_loss', 'out_2_loss', 'out_1_acc', 'out_2_acc']`. The model metric names excluding the loss metrics will be `['out_1_acc', 'out_2_acc']`. export_outputs: Optional dictionary. This can be used to override the - default Keras model output exports in a multi IO model use case and + default TF-Keras model output exports in a multi IO model use case and provide custom names for the `export_outputs` in `tf.estimator.EstimatorSpec`. Default is None, which is equivalent to {'serving_default': `tf.estimator.export.PredictOutput`}. If not None, @@ -202,11 +202,11 @@ def model_to_estimator_v2( """Constructs an `Estimator` instance from given keras model. If you use infrastructure or other tooling that relies on Estimators, you - can still build a Keras model and use model_to_estimator to convert the - Keras model to an Estimator for use with downstream systems. + can still build a TF-Keras model and use model_to_estimator to convert the + TF-Keras model to an Estimator for use with downstream systems. For usage example, please see: - [Creating estimators from Keras Models]( + [Creating estimators from TF-Keras Models]( https://www.tensorflow.org/guide/estimators#creating_estimators_from_keras_models). Sample Weights: @@ -253,7 +253,7 @@ def input_fn(): estimator.train(input_fn, steps=1) ``` - Note: We do not support creating weighted metrics in Keras and converting + Note: We do not support creating weighted metrics in TF-Keras and converting them to weighted metrics in the Estimator API using `model_to_estimator`. You will have to create these metrics directly on the estimator spec using the `add_metrics` function. @@ -294,10 +294,10 @@ def input_fn(): ``` Args: - keras_model: A compiled Keras model object. This argument is mutually + keras_model: A compiled TF-Keras model object. This argument is mutually exclusive with `keras_model_path`. Estimator's `model_fn` uses the structure of the model to clone the model. Defaults to `None`. - keras_model_path: Path to a compiled Keras model saved on disk, in HDF5 + keras_model_path: Path to a compiled TF-Keras model saved on disk, in HDF5 format, which can be generated with the `save()` method of a Keras model. This argument is mutually exclusive with `keras_model`. Defaults to `None`. @@ -318,23 +318,23 @@ def input_fn(): estimator when training. May be `saver` or `checkpoint`, depending on whether to save checkpoints from `tf.compat.v1.train.Saver` or `tf.train.Checkpoint`. The default is `checkpoint`. Estimators use - name-based `tf.train.Saver` checkpoints, while Keras models use + name-based `tf.train.Saver` checkpoints, while TF-Keras models use object-based checkpoints from `tf.train.Checkpoint`. Currently, saving object-based checkpoints from `model_to_estimator` is only supported by Functional and Sequential models. Defaults to 'checkpoint'. - metric_names_map: Optional dictionary mapping Keras model output metric + metric_names_map: Optional dictionary mapping TF-Keras model output metric names to custom names. This can be used to override the default Keras model output metrics names in a multi IO model use case and provide custom names for the `eval_metric_ops` in Estimator. - The Keras model metric names can be obtained using `model.metrics_names` + The TF-Keras model metric names can be obtained using `model.metrics_names` excluding any loss metrics such as total loss and output losses. - For example, if your Keras model has two outputs `out_1` and `out_2`, + For example, if your TF-Keras model has two outputs `out_1` and `out_2`, with `mse` loss and `acc` metric, then `model.metrics_names` will be `['loss', 'out_1_loss', 'out_2_loss', 'out_1_acc', 'out_2_acc']`. The model metric names excluding the loss metrics will be `['out_1_acc', 'out_2_acc']`. export_outputs: Optional dictionary. This can be used to override the - default Keras model output exports in a multi IO model use case and + default TF-Keras model output exports in a multi IO model use case and provide custom names for the `export_outputs` in `tf.estimator.EstimatorSpec`. Default is None, which is equivalent to {'serving_default': `tf.estimator.export.PredictOutput`}. If not None, diff --git a/keras/export/BUILD b/tf_keras/export/BUILD similarity index 60% rename from keras/export/BUILD rename to tf_keras/export/BUILD index 329076caf..be8787906 100644 --- a/keras/export/BUILD +++ b/tf_keras/export/BUILD @@ -1,14 +1,14 @@ # Description: -# Contains the Keras save model API (internal TensorFlow version). +# Contains the TF-Keras save model API (internal TensorFlow version). # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], # TODO(scottzhu): Remove non-keras deps from TF. default_visibility = [ - "//keras:friends", + "//tf_keras:friends", ], licenses = ["notice"], ) @@ -31,9 +31,9 @@ tf_py_test( python_version = "PY3", deps = [ ":export_lib", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/keras/export/__init__.py b/tf_keras/export/__init__.py similarity index 92% rename from keras/export/__init__.py rename to tf_keras/export/__init__.py index a82948d13..4439066b2 100644 --- a/keras/export/__init__.py +++ b/tf_keras/export/__init__.py @@ -13,4 +13,4 @@ # limitations under the License. # ============================================================================== -from keras.export.export_lib import ExportArchive +from tf_keras.export.export_lib import ExportArchive diff --git a/keras/export/export_lib.py b/tf_keras/export/export_lib.py similarity index 96% rename from keras/export/export_lib.py rename to tf_keras/export/export_lib.py index eb8dc63f8..8156c7d0c 100644 --- a/keras/export/export_lib.py +++ b/tf_keras/export/export_lib.py @@ -12,23 +12,23 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Library for exporting inference-only Keras models/layers.""" +"""Library for exporting inference-only TF-Keras models/layers.""" import tensorflow.compat.v2 as tf from tensorflow.python.util.tf_export import keras_export -from keras.engine import base_layer -from keras.engine import functional -from keras.engine import sequential -from keras.utils import io_utils +from tf_keras.engine import base_layer +from tf_keras.engine import functional +from tf_keras.engine import sequential +from tf_keras.utils import io_utils @keras_export("keras.export.ExportArchive") class ExportArchive(tf.__internal__.tracking.AutoTrackable): """ExportArchive is used to write SavedModel artifacts (e.g. for inference). - If you have a Keras model or layer that you want to export as SavedModel for - serving (e.g. via TensorFlow-Serving), you can use `ExportArchive` + If you have a TF-Keras model or layer that you want to export as SavedModel + for serving (e.g. via TensorFlow-Serving), you can use `ExportArchive` to configure the different serving endpoints you need to make available, as well as their signatures. Simply instantiate an `ExportArchive`, use `track()` to register the layer(s) or model(s) to be used, @@ -104,7 +104,8 @@ def track(self, resource): if not isinstance(resource, tf.__internal__.tracking.Trackable): raise ValueError( "Invalid resource type. Expected an instance of a " - "TensorFlow `Trackable` (such as a Keras `Layer` or `Model`). " + "TensorFlow `Trackable` (such as a TF-Keras " + "`Layer` or `Model`). " f"Received instead an object of type '{type(resource)}'. " f"Object received: {resource}" ) @@ -383,13 +384,17 @@ def _filter_and_track_resources(self): # Next, track lookup tables. # Hopefully, one day this will be automated at the tf.function level. self._misc_assets = [] - from keras.layers.preprocessing.index_lookup import IndexLookup + from tensorflow.python.ops.lookup_ops import ( + LookupInterface, + ) + + from tf_keras.layers.preprocessing.index_lookup import IndexLookup if hasattr(self, "_tracked"): for root in self._tracked: descendants = tf.train.TrackableView(root).descendants() for trackable in descendants: - if isinstance(trackable, IndexLookup): + if isinstance(trackable, (IndexLookup, LookupInterface)): self._misc_assets.append(trackable) @@ -414,7 +419,7 @@ def export_model(model, filepath): class ReloadedLayer(base_layer.Layer): - """Reload a Keras model/layer that was saved via SavedModel / ExportArchive. + """Reload a TF-Keras model/layer saved via SavedModel / ExportArchive. Arguments: filepath: `str` or `pathlib.Path` object. The path to the SavedModel. @@ -432,7 +437,7 @@ class ReloadedLayer(base_layer.Layer): outputs = reloaded_layer(inputs) ``` - The reloaded object can be used like a regular Keras layer, and supports + The reloaded object can be used like a regular TF-Keras layer, and supports training/fine-tuning of its trainable weights. Note that the reloaded object retains none of the internal structure or custom methods of the original object -- it's a brand new layer created around the saved diff --git a/keras/export/export_lib_test.py b/tf_keras/export/export_lib_test.py similarity index 93% rename from keras/export/export_lib_test.py rename to tf_keras/export/export_lib_test.py index 988b9a149..62d11a2e2 100644 --- a/keras/export/export_lib_test.py +++ b/tf_keras/export/export_lib_test.py @@ -19,10 +19,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.export import export_lib -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.export import export_lib +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils def get_model(): @@ -213,7 +213,7 @@ def test_multi_input_output_functional_model(self): atol=1e-6, ) - def test_model_with_lookup_table(self): + def test_model_with_keras_lookup_table(self): temp_filepath = os.path.join(self.get_temp_dir(), "exported_model") text_vectorization = keras.layers.TextVectorization() text_vectorization.adapt(["one two", "three four", "five six"]) @@ -233,6 +233,47 @@ def test_model_with_lookup_table(self): ref_output, revived_model.serve(ref_input).numpy(), atol=1e-6 ) + def test_model_with_tf_lookup_table(self): + temp_filepath = os.path.join(self.get_temp_dir(), "exported_model") + + class MyVocabTable(keras.layers.Layer): + def __init__(self, vocab): + super().__init__() + self.keys = [""] + vocab + self.values = range(len(self.keys)) + + self.init = tf.lookup.KeyValueTensorInitializer( + self.keys, + self.values, + key_dtype=tf.string, + value_dtype=tf.int64, + ) + + num_oov_buckets = 1 + + self.table = tf.lookup.StaticVocabularyTable( + self.init, num_oov_buckets + ) + + def call(self, x): + result = self.table.lookup(x) + if isinstance(result, tf.RaggedTensor): + result = result.to_tensor() + return result + + vocab_table = MyVocabTable(["a", "b", "c"]) + vocab_table(tf.constant([""] + list("abcdefg"))) + + model = keras.Sequential([vocab_table]) + ref_input = tf.constant([""] + list("abcdefg")) + ref_output = model(ref_input) + + export_lib.export_model(model, temp_filepath) + revived_model = tf.saved_model.load(temp_filepath) + self.assertAllClose( + ref_output, revived_model.serve(ref_input).numpy(), atol=1e-6 + ) + def test_track_multiple_layers(self): temp_filepath = os.path.join(self.get_temp_dir(), "exported_model") layer_1 = keras.layers.Dense(2) diff --git a/keras/feature_column/BUILD b/tf_keras/feature_column/BUILD similarity index 73% rename from keras/feature_column/BUILD rename to tf_keras/feature_column/BUILD index 6684bc5da..36328e2f2 100644 --- a/keras/feature_column/BUILD +++ b/tf_keras/feature_column/BUILD @@ -1,10 +1,10 @@ # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/tensorflow/python/feature_column:__subpackages__", # For unit testing "//third_party/tensorflow/python/tpu:__subpackages__", # For unit testing ], @@ -29,8 +29,8 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/engine:base_layer", - "//keras/utils:generic_utils", + "//tf_keras/engine:base_layer", + "//tf_keras/utils:generic_utils", ], ) @@ -43,7 +43,7 @@ py_library( deps = [ ":base_feature_layer", "//:expect_tensorflow_installed", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -57,7 +57,7 @@ py_library( ":base_feature_layer", ":dense_features", "//:expect_tensorflow_installed", - "//keras/utils:tf_contextlib", + "//tf_keras/utils:tf_contextlib", ], ) @@ -68,8 +68,8 @@ tf_py_test( deps = [ ":dense_features", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -80,8 +80,8 @@ tf_py_test( deps = [ ":dense_features_v2", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -92,7 +92,7 @@ py_library( deps = [ ":base_feature_layer", "//:expect_tensorflow_installed", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -101,10 +101,10 @@ tf_py_test( srcs = ["sequence_feature_column_test.py"], deps = [ ":sequence_feature_column", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -118,9 +118,9 @@ tf_py_test( ":dense_features", ":sequence_feature_column", "//:expect_tensorflow_installed", - "//keras/layers/core", - "//keras/layers/merging", - "//keras/layers/rnn", - "//keras/metrics", # Import it here since base_layer didn't import it due to circular dependency. + "//tf_keras/layers/core", + "//tf_keras/layers/merging", + "//tf_keras/layers/rnn", + "//tf_keras/metrics", # Import it here since base_layer didn't import it due to circular dependency. ], ) diff --git a/keras/feature_column/__init__.py b/tf_keras/feature_column/__init__.py similarity index 100% rename from keras/feature_column/__init__.py rename to tf_keras/feature_column/__init__.py diff --git a/keras/feature_column/base_feature_layer.py b/tf_keras/feature_column/base_feature_layer.py similarity index 98% rename from keras/feature_column/base_feature_layer.py rename to tf_keras/feature_column/base_feature_layer.py index 085ccc6c3..3a4adaa25 100644 --- a/keras/feature_column/base_feature_layer.py +++ b/tf_keras/feature_column/base_feature_layer.py @@ -15,7 +15,7 @@ """This API defines FeatureColumn abstraction.""" # This file was originally under tf/python/feature_column, and was moved to -# Keras package in order to remove the reverse dependency from TF to Keras. +# TF-Keras package in order to remove the reverse dependency from TF to TF-Keras. from __future__ import absolute_import from __future__ import division @@ -26,8 +26,8 @@ import tensorflow.compat.v2 as tf -from keras.engine.base_layer import Layer -from keras.saving import serialization_lib +from tf_keras.engine.base_layer import Layer +from tf_keras.saving import serialization_lib class _BaseFeaturesLayer(Layer): diff --git a/keras/feature_column/dense_features.py b/tf_keras/feature_column/dense_features.py similarity index 97% rename from keras/feature_column/dense_features.py rename to tf_keras/feature_column/dense_features.py index f5ae66458..92e44926a 100644 --- a/keras/feature_column/dense_features.py +++ b/tf_keras/feature_column/dense_features.py @@ -22,9 +22,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.feature_column import base_feature_layer as kfc -from keras.saving.legacy.saved_model import json_utils +from tf_keras import backend +from tf_keras.feature_column import base_feature_layer as kfc +from tf_keras.saving.legacy.saved_model import json_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -45,7 +45,7 @@ class DenseFeatures(kfc._BaseFeaturesLayer): Variable scopes are deprecated in V2, so the V2 version uses name_scopes instead. But currently that lacks support for partitioned variables. Use this if you need partitioned variables. Use the partitioner argument if you - have a Keras model and uses + have a TF-Keras model and uses `tf.compat.v1.keras.estimator.model_to_estimator` for training. Example: diff --git a/keras/feature_column/dense_features_test.py b/tf_keras/feature_column/dense_features_test.py similarity index 99% rename from keras/feature_column/dense_features_test.py rename to tf_keras/feature_column/dense_features_test.py index a89c0f256..5547c0cce 100644 --- a/keras/feature_column/dense_features_test.py +++ b/tf_keras/feature_column/dense_features_test.py @@ -22,8 +22,8 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.feature_column import dense_features as df -from keras.testing_infra import test_combinations +from tf_keras.feature_column import dense_features as df +from tf_keras.testing_infra import test_combinations # isort: off from tensorflow.python.eager import backprop diff --git a/keras/feature_column/dense_features_v2.py b/tf_keras/feature_column/dense_features_v2.py similarity index 97% rename from keras/feature_column/dense_features_v2.py rename to tf_keras/feature_column/dense_features_v2.py index f731d7163..be68a7663 100644 --- a/keras/feature_column/dense_features_v2.py +++ b/tf_keras/feature_column/dense_features_v2.py @@ -20,9 +20,9 @@ import tensorflow.compat.v2 as tf -from keras.feature_column import base_feature_layer as kfc -from keras.feature_column import dense_features -from keras.utils import tf_contextlib +from tf_keras.feature_column import base_feature_layer as kfc +from tf_keras.feature_column import dense_features +from tf_keras.utils import tf_contextlib # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/feature_column/dense_features_v2_test.py b/tf_keras/feature_column/dense_features_v2_test.py similarity index 99% rename from keras/feature_column/dense_features_v2_test.py rename to tf_keras/feature_column/dense_features_v2_test.py index d984fced6..3ad8c5f4c 100644 --- a/keras/feature_column/dense_features_v2_test.py +++ b/tf_keras/feature_column/dense_features_v2_test.py @@ -21,8 +21,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.feature_column import dense_features_v2 as df -from keras.testing_infra import test_combinations +from tf_keras.feature_column import dense_features_v2 as df +from tf_keras.testing_infra import test_combinations # isort: off from tensorflow.python.eager import backprop diff --git a/keras/feature_column/sequence_feature_column.py b/tf_keras/feature_column/sequence_feature_column.py similarity index 98% rename from keras/feature_column/sequence_feature_column.py rename to tf_keras/feature_column/sequence_feature_column.py index 89e4f5cfd..2f1d95765 100644 --- a/keras/feature_column/sequence_feature_column.py +++ b/tf_keras/feature_column/sequence_feature_column.py @@ -23,8 +23,8 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.feature_column import base_feature_layer as kfc +from tf_keras import backend +from tf_keras.feature_column import base_feature_layer as kfc # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/feature_column/sequence_feature_column_integration_test.py b/tf_keras/feature_column/sequence_feature_column_integration_test.py similarity index 96% rename from keras/feature_column/sequence_feature_column_integration_test.py rename to tf_keras/feature_column/sequence_feature_column_integration_test.py index b76c04d1f..921be2373 100644 --- a/keras/feature_column/sequence_feature_column_integration_test.py +++ b/tf_keras/feature_column/sequence_feature_column_integration_test.py @@ -20,12 +20,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.feature_column import dense_features -from keras.feature_column import sequence_feature_column as ksfc -from keras.layers import merging -from keras.layers.rnn import base_rnn -from keras.layers.rnn import simple_rnn +from tf_keras import backend +from tf_keras.feature_column import dense_features +from tf_keras.feature_column import sequence_feature_column as ksfc +from tf_keras.layers import merging +from tf_keras.layers.rnn import base_rnn +from tf_keras.layers.rnn import simple_rnn # isort: off from google.protobuf import text_format diff --git a/keras/feature_column/sequence_feature_column_test.py b/tf_keras/feature_column/sequence_feature_column_test.py similarity index 99% rename from keras/feature_column/sequence_feature_column_test.py rename to tf_keras/feature_column/sequence_feature_column_test.py index 3e5b9ef18..fdb1527d5 100644 --- a/keras/feature_column/sequence_feature_column_test.py +++ b/tf_keras/feature_column/sequence_feature_column_test.py @@ -22,10 +22,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.feature_column import sequence_feature_column as ksfc -from keras.saving.legacy import model_config -from keras.testing_infra import test_combinations +import tf_keras as keras +from tf_keras.feature_column import sequence_feature_column as ksfc +from tf_keras.saving.legacy import model_config +from tf_keras.testing_infra import test_combinations def _initialized_session(config=None): diff --git a/keras/initializers/BUILD b/tf_keras/initializers/BUILD similarity index 51% rename from keras/initializers/BUILD rename to tf_keras/initializers/BUILD index 5dadf380f..b34e9f804 100644 --- a/keras/initializers/BUILD +++ b/tf_keras/initializers/BUILD @@ -1,13 +1,13 @@ # Description: -# Contains the Keras initializer API (internal TensorFlow version). +# Contains the TF-Keras initializer API (internal TensorFlow version). # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", ], licenses = ["notice"], ) @@ -22,11 +22,11 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/dtensor:utils", - "//keras/saving:serialization_lib", - "//keras/utils:generic_utils", - "//keras/utils:tf_inspect", + "//tf_keras:backend", + "//tf_keras/dtensor:utils", + "//tf_keras/saving:serialization_lib", + "//tf_keras/utils:generic_utils", + "//tf_keras/utils:tf_inspect", ], ) @@ -39,9 +39,9 @@ tf_py_test( ":initializers", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine", - "//keras/models", - "//keras/testing_infra:test_combinations", + "//tf_keras:backend", + "//tf_keras/engine", + "//tf_keras/models", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/keras/initializers/__init__.py b/tf_keras/initializers/__init__.py similarity index 95% rename from keras/initializers/__init__.py rename to tf_keras/initializers/__init__.py index 0069ca2a0..0df68f61a 100644 --- a/keras/initializers/__init__.py +++ b/tf_keras/initializers/__init__.py @@ -19,12 +19,12 @@ import tensorflow.compat.v2 as tf -from keras.initializers import initializers -from keras.initializers import initializers_v1 -from keras.saving import serialization_lib -from keras.saving.legacy import serialization as legacy_serialization -from keras.utils import generic_utils -from keras.utils import tf_inspect as inspect +from tf_keras.initializers import initializers +from tf_keras.initializers import initializers_v1 +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy import serialization as legacy_serialization +from tf_keras.utils import generic_utils +from tf_keras.utils import tf_inspect as inspect # isort: off from tensorflow.python import tf2 @@ -175,7 +175,7 @@ def deserialize(config, custom_objects=None, use_legacy_format=False): @keras_export("keras.initializers.get") def get(identifier): - """Retrieve a Keras initializer by the identifier. + """Retrieve a TF-Keras initializer by the identifier. The `identifier` may be the string name of a initializers function or class (case-sensitively). diff --git a/keras/initializers/initializers.py b/tf_keras/initializers/initializers.py similarity index 98% rename from keras/initializers/initializers.py rename to tf_keras/initializers/initializers.py index 8fc3da655..e8a236106 100644 --- a/keras/initializers/initializers.py +++ b/tf_keras/initializers/initializers.py @@ -19,9 +19,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.dtensor import utils -from keras.saving import serialization_lib +from tf_keras import backend +from tf_keras.dtensor import utils +from tf_keras.saving import serialization_lib # isort: off from tensorflow.python.util.tf_export import keras_export @@ -34,7 +34,7 @@ @keras_export("keras.initializers.Initializer") class Initializer: - """Initializer base class: all Keras initializers inherit from this class. + """Initializer base class: all TF-Keras initializers inherit from this class. Initializers should implement a `__call__()` method with the following signature: @@ -48,7 +48,7 @@ def __call__(self, shape, dtype=None, **kwargs): Optionally, you an also implement the method `get_config()` and the class method `from_config()` in order to support serialization -- just like with - any Keras object. + any TF-Keras object. Here's a simple example: a random normal initializer. @@ -141,7 +141,7 @@ class Zeros(Initializer): >>> initializer = tf.keras.initializers.Zeros() >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.Zeros() >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) """ @@ -183,7 +183,7 @@ class Ones(Initializer): >>> initializer = tf.keras.initializers.Ones() >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.Ones() >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) """ @@ -231,7 +231,7 @@ class Constant(Initializer): >>> initializer = tf.keras.initializers.Constant(3.) >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.Constant(3.) >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) @@ -295,7 +295,7 @@ class RandomUniform(Initializer): >>> initializer = tf.keras.initializers.RandomUniform(minval=0., maxval=1.) >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.RandomUniform(minval=0., maxval=1.) >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) @@ -376,7 +376,7 @@ class RandomNormal(Initializer): >>> initializer = tf.keras.initializers.RandomNormal(mean=0., stddev=1.) >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.RandomNormal(mean=0., stddev=1.) >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) @@ -461,7 +461,7 @@ class TruncatedNormal(Initializer): >>> initializer = tf.keras.initializers.TruncatedNormal(mean=0., stddev=1.) >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.TruncatedNormal(mean=0., stddev=1.) >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) @@ -559,7 +559,7 @@ class VarianceScaling(Initializer): ... scale=0.1, mode='fan_in', distribution='uniform') >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.VarianceScaling( ... scale=0.1, mode='fan_in', distribution='uniform') >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) @@ -707,7 +707,7 @@ class Orthogonal(Initializer): >>> initializer = tf.keras.initializers.Orthogonal() >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.Orthogonal() >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) @@ -799,7 +799,7 @@ class Identity(Initializer): >>> initializer = tf.keras.initializers.Identity() >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.Identity() >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) @@ -866,7 +866,7 @@ class GlorotUniform(VarianceScaling): >>> initializer = tf.keras.initializers.GlorotUniform() >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.GlorotUniform() >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) @@ -909,7 +909,7 @@ class GlorotNormal(VarianceScaling): >>> initializer = tf.keras.initializers.GlorotNormal() >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.GlorotNormal() >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) @@ -958,7 +958,7 @@ class LecunNormal(VarianceScaling): >>> initializer = tf.keras.initializers.LecunNormal() >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.LecunNormal() >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) @@ -1000,7 +1000,7 @@ class LecunUniform(VarianceScaling): >>> initializer = tf.keras.initializers.LecunUniform() >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.LecunUniform() >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) @@ -1042,7 +1042,7 @@ class HeNormal(VarianceScaling): >>> initializer = tf.keras.initializers.HeNormal() >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.HeNormal() >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) @@ -1084,7 +1084,7 @@ class HeUniform(VarianceScaling): >>> initializer = tf.keras.initializers.HeUniform() >>> values = initializer(shape=(2, 2)) - >>> # Usage in a Keras layer: + >>> # Usage in a TF-Keras layer: >>> initializer = tf.keras.initializers.HeUniform() >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer) @@ -1186,6 +1186,6 @@ def _ensure_keras_seeded(): if not getattr(backend._SEED_GENERATOR, "generator", None): raise ValueError( "When using DTensor APIs, you need to set the global seed " - "before using any Keras initializers. Please make sure " + "before using any TF-Keras initializers. Please make sure " "to call `tf.keras.utils.set_random_seed()` in your code." ) diff --git a/keras/initializers/initializers_test.py b/tf_keras/initializers/initializers_test.py similarity index 97% rename from keras/initializers/initializers_test.py rename to tf_keras/initializers/initializers_test.py index a45f54f6d..dd4688518 100644 --- a/keras/initializers/initializers_test.py +++ b/tf_keras/initializers/initializers_test.py @@ -12,20 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras initializers.""" +"""Tests for TF-Keras initializers.""" import warnings import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import backend -from keras import initializers -from keras import models -from keras.engine import input_layer -from keras.layers import core -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras import backend +from tf_keras import initializers +from tf_keras import models +from tf_keras.engine import input_layer +from tf_keras.layers import core +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils RANDOM_INITIALIZERS = [ initializers.RandomUniformV2, diff --git a/keras/initializers/initializers_v1.py b/tf_keras/initializers/initializers_v1.py similarity index 100% rename from keras/initializers/initializers_v1.py rename to tf_keras/initializers/initializers_v1.py diff --git a/keras/integration_test/BUILD b/tf_keras/integration_test/BUILD similarity index 76% rename from keras/integration_test/BUILD rename to tf_keras/integration_test/BUILD index 348db2520..e26fb1240 100644 --- a/keras/integration_test/BUILD +++ b/tf_keras/integration_test/BUILD @@ -1,16 +1,16 @@ # Description: -# Contains Keras integration tests that verify with other TF high level APIs. +# Contains TF-Keras integration tests that verify with other TF high level APIs. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "cuda_py_test") -load("@org_keras//keras:keras.bzl", "tf_py_test") # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "tpu_py_test") -load("@org_keras//keras:keras.bzl", "distribute_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") # buildifier: disable=same-origin-load +load("@org_keras//tf_keras:tf_keras.bzl", "tpu_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "distribute_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/tensorflow/tools/pip_package:__pkg__", ], licenses = ["notice"], @@ -21,9 +21,9 @@ tf_py_test( srcs = ["forwardprop_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -33,7 +33,7 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -43,7 +43,7 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -52,9 +52,9 @@ cuda_py_test( srcs = ["saved_model_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -64,7 +64,7 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -73,7 +73,7 @@ tf_py_test( srcs = ["module_test.py"], deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -83,7 +83,7 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -94,7 +94,7 @@ cuda_py_test( tags = ["no_oss"], # TODO(b/249526796) deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -107,10 +107,10 @@ cuda_py_test( "no_windows_gpu", # TODO(b/130551176) ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/utils:kpl_test_utils", + "//tf_keras/api:keras_api", + "//tf_keras/utils:kpl_test_utils", ], ) @@ -122,7 +122,7 @@ tpu_py_test( python_version = "PY3", tags = ["no_oss"], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", ], ) @@ -140,10 +140,10 @@ tf_py_test( "notsan", # TODO(b/156029134) ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_portpicker_installed", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -157,10 +157,10 @@ distribute_py_test( "nomultivm", # TODO(b/170502145) ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/distribute:strategy_combinations", + "//tf_keras/api:keras_api", + "//tf_keras/distribute:strategy_combinations", ], ) @@ -176,12 +176,12 @@ distribute_py_test( "notap", # b/216629693 ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_portpicker_installed", "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/testing_infra:test_utils", + "//tf_keras/api:keras_api", + "//tf_keras/testing_infra:test_utils", ], ) @@ -201,7 +201,7 @@ distribute_py_test( ], deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -220,7 +220,7 @@ distribute_py_test( ], deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -248,7 +248,7 @@ distribute_py_test( deps = [ ":preprocessing_test_utils", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -269,7 +269,7 @@ distribute_py_test( deps = [ ":preprocessing_test_utils", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -290,7 +290,7 @@ distribute_py_test( deps = [ ":preprocessing_test_utils", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -309,7 +309,7 @@ distribute_py_test( ], deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -319,8 +319,8 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/testing_infra:test_combinations", + "//tf_keras/api:keras_api", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -335,9 +335,9 @@ tf_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -349,9 +349,9 @@ tf_py_test( shard_count = 28, deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/integration_test/models", - "//keras/testing_infra:test_combinations", + "//tf_keras/api:keras_api", + "//tf_keras/integration_test/models", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -363,9 +363,9 @@ tf_py_test( shard_count = 12, deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/integration_test/models", - "//keras/testing_infra:test_combinations", + "//tf_keras/api:keras_api", + "//tf_keras/integration_test/models", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -377,9 +377,9 @@ tf_py_test( shard_count = 2, deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/metrics", - "//keras/testing_infra:test_combinations", + "//tf_keras/api:keras_api", + "//tf_keras/metrics", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -390,10 +390,10 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/engine", - "//keras/engine:input_layer", - "//keras/saving", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/engine", + "//tf_keras/engine:input_layer", + "//tf_keras/saving", ], ) diff --git a/keras/integration_test/README.md b/tf_keras/integration_test/README.md similarity index 60% rename from keras/integration_test/README.md rename to tf_keras/integration_test/README.md index 4d40893f6..d16398908 100644 --- a/keras/integration_test/README.md +++ b/tf_keras/integration_test/README.md @@ -1,12 +1,12 @@ -# Keras Integration Test +# TF-Keras Integration Test This package contains integration tests that ensure the correct interaction -between Keras and other Tensorflow high level APIs, like dataset, TF function +between TF-Keras and other Tensorflow high level APIs, like dataset, TF function and distribution strategy, etc. There are a few guidelines for the tests under this package. *. Only use the public TF API. -*. Test should focus on the end to end use case between Keras and other TF high +*. Test should focus on the end to end use case between TF-Keras and other TF high level API. Unit test will be a better place for behavior testing for the individual APIs. diff --git a/keras/integration_test/central_storage_strategy_test.py b/tf_keras/integration_test/central_storage_strategy_test.py similarity index 98% rename from keras/integration_test/central_storage_strategy_test.py rename to tf_keras/integration_test/central_storage_strategy_test.py index 5c1a67085..2ea743e21 100644 --- a/keras/integration_test/central_storage_strategy_test.py +++ b/tf_keras/integration_test/central_storage_strategy_test.py @@ -19,7 +19,7 @@ # isort: off from tensorflow.compat.v2.__internal__.distribute import combinations -from keras.utils import kpl_test_utils +from tf_keras.utils import kpl_test_utils # TODO(b/182278926): Combine this test with other strategies. diff --git a/keras/integration_test/ctl_tutorial_test.py b/tf_keras/integration_test/ctl_tutorial_test.py similarity index 99% rename from keras/integration_test/ctl_tutorial_test.py rename to tf_keras/integration_test/ctl_tutorial_test.py index e700d9ed4..db964605a 100644 --- a/keras/integration_test/ctl_tutorial_test.py +++ b/tf_keras/integration_test/ctl_tutorial_test.py @@ -20,7 +20,7 @@ makes several statements about * ways to reduce loss terms to the actual training loss, and - * how they compare to the built-in behavior of Keras Model.fit(). + * how they compare to the built-in behavior of TF-Keras Model.fit(). This test verifies that these statements match the actual behavior, under a variety of distribution strategies. @@ -30,7 +30,7 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.distribute import strategy_combinations +from tf_keras.distribute import strategy_combinations def make_compute_loss_fn(variant, loss_object, GLOBAL_BATCH_SIZE): diff --git a/keras/integration_test/custom_object_saving_test.py b/tf_keras/integration_test/custom_object_saving_test.py similarity index 96% rename from keras/integration_test/custom_object_saving_test.py rename to tf_keras/integration_test/custom_object_saving_test.py index 3c20d80d4..66d3f7775 100644 --- a/keras/integration_test/custom_object_saving_test.py +++ b/tf_keras/integration_test/custom_object_saving_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Test for custom Keras object saving with `register_keras_serializable`.""" +"""Test for custom TF-Keras object saving with `register_keras_serializable`.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -24,14 +24,14 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.testing_infra import test_utils -from keras.utils import get_custom_objects +from tf_keras.testing_infra import test_utils +from tf_keras.utils import get_custom_objects # `tf.print` message is only available in stderr in TF2, which this test checks. @test_utils.run_v2_only class CustomObjectSavingTest(tf.test.TestCase, parameterized.TestCase): - """Test for custom Keras object saving with + """Test for custom TF-Keras object saving with `register_keras_serializable`.""" def setUp(self): diff --git a/keras/integration_test/data/sentencepiece.pb b/tf_keras/integration_test/data/sentencepiece.pb similarity index 100% rename from keras/integration_test/data/sentencepiece.pb rename to tf_keras/integration_test/data/sentencepiece.pb diff --git a/keras/integration_test/distributed_training_test.py b/tf_keras/integration_test/distributed_training_test.py similarity index 96% rename from keras/integration_test/distributed_training_test.py rename to tf_keras/integration_test/distributed_training_test.py index a0aa112d9..87ba19c45 100644 --- a/keras/integration_test/distributed_training_test.py +++ b/tf_keras/integration_test/distributed_training_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Test to demonstrate basic Keras training with a variety of strategies.""" +"""Test to demonstrate basic TF-Keras training with a variety of strategies.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -45,7 +45,7 @@ tf.__internal__.test.combinations.combine(strategy=STRATEGIES, mode="eager") ) class DistributedTrainingTest(tf.test.TestCase): - """Test to demonstrate basic Keras training with a variety of strategies.""" + """Test to demonstrate basic TF-Keras training with a variety of strategies.""" def testKerasTrainingAPI(self, strategy): if not tf.__internal__.tf2.enabled() and isinstance( diff --git a/keras/integration_test/extension_type_test.py b/tf_keras/integration_test/extension_type_test.py similarity index 90% rename from keras/integration_test/extension_type_test.py rename to tf_keras/integration_test/extension_type_test.py index a7a0d0505..277ea0a27 100644 --- a/keras/integration_test/extension_type_test.py +++ b/tf_keras/integration_test/extension_type_test.py @@ -5,18 +5,18 @@ import tensorflow.compat.v2 as tf -import keras -from keras.engine.input_layer import Input -from keras.engine.training import Model -from keras.saving.saving_api import load_model -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.engine.input_layer import Input +from tf_keras.engine.training import Model +from tf_keras.saving.saving_api import load_model +from tf_keras.testing_infra import test_utils class MaskedTensor(tf.experimental.BatchableExtensionType): """Example subclass of ExtensionType, used for testing. - This version adds Keras required properties to MaskedTensor and its Spec - class, to test Keras integration. + This version adds TF-Keras required properties to MaskedTensor and its Spec + class, to test TF-Keras integration. """ __name__ = "tf.test.MaskedTensor.Spec" diff --git a/keras/integration_test/fit_test.py b/tf_keras/integration_test/fit_test.py similarity index 74% rename from keras/integration_test/fit_test.py rename to tf_keras/integration_test/fit_test.py index bbd0134d4..e7403af98 100644 --- a/keras/integration_test/fit_test.py +++ b/tf_keras/integration_test/fit_test.py @@ -3,24 +3,24 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.integration_test.models import bert -from keras.integration_test.models import dcgan -from keras.integration_test.models import edge_case_model -from keras.integration_test.models import efficientnet_v2 -from keras.integration_test.models import input_spec -from keras.integration_test.models import low_level_model -from keras.integration_test.models import mini_unet -from keras.integration_test.models import mini_xception -from keras.integration_test.models import retinanet -from keras.integration_test.models import structured_data_classification -from keras.integration_test.models import text_classification -from keras.integration_test.models import timeseries_forecasting -from keras.integration_test.models import vae -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras.integration_test.models import bert +from tf_keras.integration_test.models import dcgan +from tf_keras.integration_test.models import edge_case_model +from tf_keras.integration_test.models import efficientnet_v2 +from tf_keras.integration_test.models import input_spec +from tf_keras.integration_test.models import low_level_model +from tf_keras.integration_test.models import mini_unet +from tf_keras.integration_test.models import mini_xception +from tf_keras.integration_test.models import retinanet +from tf_keras.integration_test.models import structured_data_classification +from tf_keras.integration_test.models import text_classification +from tf_keras.integration_test.models import timeseries_forecasting +from tf_keras.integration_test.models import vae +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils -# from keras.integration_test.models import ctc_speech_rnn -# from keras.integration_test.models import translation +# from tf_keras.integration_test.models import ctc_speech_rnn +# from tf_keras.integration_test.models import translation def get_dataset(data_specs, batch_size): diff --git a/keras/integration_test/forwardprop_test.py b/tf_keras/integration_test/forwardprop_test.py similarity index 100% rename from keras/integration_test/forwardprop_test.py rename to tf_keras/integration_test/forwardprop_test.py diff --git a/keras/integration_test/function_test.py b/tf_keras/integration_test/function_test.py similarity index 100% rename from keras/integration_test/function_test.py rename to tf_keras/integration_test/function_test.py diff --git a/keras/integration_test/gradient_checkpoint_test.py b/tf_keras/integration_test/gradient_checkpoint_test.py similarity index 100% rename from keras/integration_test/gradient_checkpoint_test.py rename to tf_keras/integration_test/gradient_checkpoint_test.py diff --git a/keras/integration_test/gradients_test.py b/tf_keras/integration_test/gradients_test.py similarity index 98% rename from keras/integration_test/gradients_test.py rename to tf_keras/integration_test/gradients_test.py index dd24e9c8d..850cc9cbb 100644 --- a/keras/integration_test/gradients_test.py +++ b/tf_keras/integration_test/gradients_test.py @@ -53,7 +53,7 @@ def _TestVariablesGradient(self, inputs, test_model, vars_to_grad): return grads_re, grads def testKerasRecompute(self): - """Checks that recompute_grad works for a simple Keras Model.""" + """Checks that recompute_grad works for a simple TF-Keras Model.""" test_model = TestKerasModelClass(10) test_input = tf.constant(tf.zeros((10, 10), dtype=np.float32)) diff --git a/keras/integration_test/legacy_rnn_test.py b/tf_keras/integration_test/legacy_rnn_test.py similarity index 99% rename from keras/integration_test/legacy_rnn_test.py rename to tf_keras/integration_test/legacy_rnn_test.py index 0b85d3643..df499fc9f 100644 --- a/keras/integration_test/legacy_rnn_test.py +++ b/tf_keras/integration_test/legacy_rnn_test.py @@ -344,7 +344,7 @@ def testRNNCellSerialization(self): weights = model.get_weights() config = layer.get_config() # The custom_objects is important here since rnn_cell_impl is - # not visible as a Keras layer, and also has a name conflict + # not visible as a TF-Keras layer, and also has a name conflict # with keras.LSTMCell and GRUCell. layer = tf.keras.layers.RNN.from_config( config, diff --git a/keras/integration_test/models/BUILD b/tf_keras/integration_test/models/BUILD similarity index 78% rename from keras/integration_test/models/BUILD rename to tf_keras/integration_test/models/BUILD index daf1ba141..9dbfab6fb 100644 --- a/keras/integration_test/models/BUILD +++ b/tf_keras/integration_test/models/BUILD @@ -1,12 +1,12 @@ # Description: -# Contains a collection of diverse Keras models to be used for integration tests. +# Contains a collection of diverse TF-Keras models to be used for integration tests. # Placeholder: load unaliased py_library package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", ], licenses = ["notice"], ) diff --git a/keras/integration_test/models/__init__.py b/tf_keras/integration_test/models/__init__.py similarity index 100% rename from keras/integration_test/models/__init__.py rename to tf_keras/integration_test/models/__init__.py diff --git a/keras/integration_test/models/bert.py b/tf_keras/integration_test/models/bert.py similarity index 97% rename from keras/integration_test/models/bert.py rename to tf_keras/integration_test/models/bert.py index ea20aa041..9c1357fd0 100644 --- a/keras/integration_test/models/bert.py +++ b/tf_keras/integration_test/models/bert.py @@ -4,9 +4,9 @@ """ import numpy as np import tensorflow as tf -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec +from tf_keras.integration_test.models.input_spec import InputSpec SEQUENCE_LENGTH = 16 VOCAB_SIZE = 1000 diff --git a/keras/integration_test/models/ctc_speech_rnn.py b/tf_keras/integration_test/models/ctc_speech_rnn.py similarity index 96% rename from keras/integration_test/models/ctc_speech_rnn.py rename to tf_keras/integration_test/models/ctc_speech_rnn.py index 1324581b8..2862001ac 100644 --- a/keras/integration_test/models/ctc_speech_rnn.py +++ b/tf_keras/integration_test/models/ctc_speech_rnn.py @@ -1,7 +1,7 @@ import tensorflow as tf -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec +from tf_keras.integration_test.models.input_spec import InputSpec TIMESTEPS = 64 INPUT_DIM = 50 diff --git a/keras/integration_test/models/dcgan.py b/tf_keras/integration_test/models/dcgan.py similarity index 97% rename from keras/integration_test/models/dcgan.py rename to tf_keras/integration_test/models/dcgan.py index ec23da91b..041f5e7ab 100644 --- a/keras/integration_test/models/dcgan.py +++ b/tf_keras/integration_test/models/dcgan.py @@ -1,8 +1,8 @@ import tensorflow as tf -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec -from keras.saving import serialization_lib +from tf_keras.integration_test.models.input_spec import InputSpec +from tf_keras.saving import serialization_lib IMG_SIZE = (64, 64) LATENT_DIM = 128 diff --git a/keras/integration_test/models/edge_case_model.py b/tf_keras/integration_test/models/edge_case_model.py similarity index 97% rename from keras/integration_test/models/edge_case_model.py rename to tf_keras/integration_test/models/edge_case_model.py index 0fd8d1670..d2c47054b 100644 --- a/keras/integration_test/models/edge_case_model.py +++ b/tf_keras/integration_test/models/edge_case_model.py @@ -2,9 +2,9 @@ """ import tensorflow as tf -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec +from tf_keras.integration_test.models.input_spec import InputSpec INPUT_DIM = 32 NUM_CLASSES = 5 diff --git a/keras/integration_test/models/efficientnet_v2.py b/tf_keras/integration_test/models/efficientnet_v2.py similarity index 98% rename from keras/integration_test/models/efficientnet_v2.py rename to tf_keras/integration_test/models/efficientnet_v2.py index 68e392671..3b140b4c7 100644 --- a/keras/integration_test/models/efficientnet_v2.py +++ b/tf_keras/integration_test/models/efficientnet_v2.py @@ -1,12 +1,12 @@ """Image classification with EfficientNetV2 architecture. -Adapted from the EfficientNetV2 Keras Application. +Adapted from the EfficientNetV2 TF-Keras Application. """ import math -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec +from tf_keras.integration_test.models.input_spec import InputSpec IMG_SIZE = (96, 96) NUM_CLASSES = 5 diff --git a/keras/integration_test/models/input_spec.py b/tf_keras/integration_test/models/input_spec.py similarity index 100% rename from keras/integration_test/models/input_spec.py rename to tf_keras/integration_test/models/input_spec.py diff --git a/keras/integration_test/models/low_level_model.py b/tf_keras/integration_test/models/low_level_model.py similarity index 97% rename from keras/integration_test/models/low_level_model.py rename to tf_keras/integration_test/models/low_level_model.py index 1bf03bbab..efa4291b3 100644 --- a/keras/integration_test/models/low_level_model.py +++ b/tf_keras/integration_test/models/low_level_model.py @@ -9,9 +9,9 @@ """ import tensorflow as tf -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec +from tf_keras.integration_test.models.input_spec import InputSpec INPUT_DIM = 32 NUM_CLASSES = 5 diff --git a/keras/integration_test/models/mini_unet.py b/tf_keras/integration_test/models/mini_unet.py similarity index 95% rename from keras/integration_test/models/mini_unet.py rename to tf_keras/integration_test/models/mini_unet.py index c44662b3f..eaf14bd62 100644 --- a/keras/integration_test/models/mini_unet.py +++ b/tf_keras/integration_test/models/mini_unet.py @@ -2,9 +2,9 @@ Adapted from https://keras.io/examples/vision/oxford_pets_image_segmentation/ """ -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec +from tf_keras.integration_test.models.input_spec import InputSpec IMG_SIZE = (224, 224) NUM_CLASSES = 5 diff --git a/keras/integration_test/models/mini_xception.py b/tf_keras/integration_test/models/mini_xception.py similarity index 95% rename from keras/integration_test/models/mini_xception.py rename to tf_keras/integration_test/models/mini_xception.py index 456e53390..718c41b69 100644 --- a/keras/integration_test/models/mini_xception.py +++ b/tf_keras/integration_test/models/mini_xception.py @@ -2,9 +2,9 @@ Adapted from https://keras.io/examples/vision/image_classification_from_scratch/ """ -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec +from tf_keras.integration_test.models.input_spec import InputSpec IMG_SIZE = (120, 120) diff --git a/keras/integration_test/models/retinanet.py b/tf_keras/integration_test/models/retinanet.py similarity index 98% rename from keras/integration_test/models/retinanet.py rename to tf_keras/integration_test/models/retinanet.py index 188fc3e99..d578b5f1c 100644 --- a/keras/integration_test/models/retinanet.py +++ b/tf_keras/integration_test/models/retinanet.py @@ -3,10 +3,10 @@ Adapted from https://keras.io/examples/vision/retinanet/ """ import tensorflow as tf -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec -from keras.saving import serialization_lib +from tf_keras.integration_test.models.input_spec import InputSpec +from tf_keras.saving import serialization_lib NUM_CLASSES = 10 IMG_SIZE = (224, 224) diff --git a/keras/integration_test/models/structured_data_classification.py b/tf_keras/integration_test/models/structured_data_classification.py similarity index 96% rename from keras/integration_test/models/structured_data_classification.py rename to tf_keras/integration_test/models/structured_data_classification.py index e53bfb063..86bc3a422 100644 --- a/keras/integration_test/models/structured_data_classification.py +++ b/tf_keras/integration_test/models/structured_data_classification.py @@ -1,7 +1,7 @@ import tensorflow as tf -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec +from tf_keras.integration_test.models.input_spec import InputSpec def get_data_spec(batch_size): diff --git a/keras/integration_test/models/text_classification.py b/tf_keras/integration_test/models/text_classification.py similarity index 96% rename from keras/integration_test/models/text_classification.py rename to tf_keras/integration_test/models/text_classification.py index 6da5a2a74..35ae35277 100644 --- a/keras/integration_test/models/text_classification.py +++ b/tf_keras/integration_test/models/text_classification.py @@ -6,9 +6,9 @@ import string import tensorflow as tf -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec +from tf_keras.integration_test.models.input_spec import InputSpec MAX_FEATURES = 1000 EMBEDDING_DIM = 64 diff --git a/keras/integration_test/models/timeseries_forecasting.py b/tf_keras/integration_test/models/timeseries_forecasting.py similarity index 87% rename from keras/integration_test/models/timeseries_forecasting.py rename to tf_keras/integration_test/models/timeseries_forecasting.py index 7f38f0821..dfff9394f 100644 --- a/keras/integration_test/models/timeseries_forecasting.py +++ b/tf_keras/integration_test/models/timeseries_forecasting.py @@ -1,6 +1,6 @@ -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec +from tf_keras.integration_test.models.input_spec import InputSpec TIMESTEPS = 32 diff --git a/keras/integration_test/models/translation.py b/tf_keras/integration_test/models/translation.py similarity index 98% rename from keras/integration_test/models/translation.py rename to tf_keras/integration_test/models/translation.py index b8488600b..360080b71 100644 --- a/keras/integration_test/models/translation.py +++ b/tf_keras/integration_test/models/translation.py @@ -4,9 +4,9 @@ https://keras.io/examples/nlp/neural_machine_translation_with_transformer/ """ import tensorflow as tf -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec +from tf_keras.integration_test.models.input_spec import InputSpec VOCAB_SIZE = 1500 SEQUENCE_LENGTH = 20 diff --git a/keras/integration_test/models/vae.py b/tf_keras/integration_test/models/vae.py similarity index 96% rename from keras/integration_test/models/vae.py rename to tf_keras/integration_test/models/vae.py index f9f08e142..fc03d4952 100644 --- a/keras/integration_test/models/vae.py +++ b/tf_keras/integration_test/models/vae.py @@ -4,10 +4,10 @@ """ import tensorflow as tf -from tensorflow import keras +from tensorflow import tf_keras as keras -from keras.integration_test.models.input_spec import InputSpec -from keras.saving import serialization_lib +from tf_keras.integration_test.models.input_spec import InputSpec +from tf_keras.saving import serialization_lib IMG_SIZE = (28, 28) LATENT_DIM = 64 diff --git a/keras/integration_test/module_test.py b/tf_keras/integration_test/module_test.py similarity index 100% rename from keras/integration_test/module_test.py rename to tf_keras/integration_test/module_test.py diff --git a/keras/integration_test/multi_worker_tutorial_test.py b/tf_keras/integration_test/multi_worker_tutorial_test.py similarity index 100% rename from keras/integration_test/multi_worker_tutorial_test.py rename to tf_keras/integration_test/multi_worker_tutorial_test.py diff --git a/keras/integration_test/mwms_multi_process_runner_test.py b/tf_keras/integration_test/mwms_multi_process_runner_test.py similarity index 94% rename from keras/integration_test/mwms_multi_process_runner_test.py rename to tf_keras/integration_test/mwms_multi_process_runner_test.py index 178b843af..0a2e8cebe 100644 --- a/keras/integration_test/mwms_multi_process_runner_test.py +++ b/tf_keras/integration_test/mwms_multi_process_runner_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Test to demonstrate Keras training with MultiWorkerMirroredStrategy.""" +"""Test to demonstrate TF-Keras training with MultiWorkerMirroredStrategy.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function @@ -28,7 +28,7 @@ class MwmsMultiProcessRunnerTest(tf.test.TestCase): - """Test to demonstrate Keras training with MultiWorkerMirroredStrategy.""" + """Test to demonstrate TF-Keras training with MultiWorkerMirroredStrategy.""" def testMwmsWithModelFit(self): def worker_fn(): diff --git a/keras/integration_test/parameter_server_custom_training_loop_test.py b/tf_keras/integration_test/parameter_server_custom_training_loop_test.py similarity index 100% rename from keras/integration_test/parameter_server_custom_training_loop_test.py rename to tf_keras/integration_test/parameter_server_custom_training_loop_test.py diff --git a/keras/integration_test/parameter_server_keras_preprocessing_test.py b/tf_keras/integration_test/parameter_server_keras_preprocessing_test.py similarity index 99% rename from keras/integration_test/parameter_server_keras_preprocessing_test.py rename to tf_keras/integration_test/parameter_server_keras_preprocessing_test.py index 5dcda78fe..33b5479fc 100644 --- a/keras/integration_test/parameter_server_keras_preprocessing_test.py +++ b/tf_keras/integration_test/parameter_server_keras_preprocessing_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for ClusterCoordinator and Keras models.""" +"""Tests for ClusterCoordinator and TF-Keras models.""" import multiprocessing import os @@ -24,7 +24,7 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.testing_infra import test_utils +from tf_keras.testing_infra import test_utils # These vocabularies usually come from TFT or a Beam pipeline. FEATURE_VOCAB = [ diff --git a/keras/integration_test/parameter_server_training_metric_test.py b/tf_keras/integration_test/parameter_server_training_metric_test.py similarity index 94% rename from keras/integration_test/parameter_server_training_metric_test.py rename to tf_keras/integration_test/parameter_server_training_metric_test.py index adae47960..3ea4371af 100644 --- a/keras/integration_test/parameter_server_training_metric_test.py +++ b/tf_keras/integration_test/parameter_server_training_metric_test.py @@ -17,10 +17,10 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import layers as layers_module -from keras import metrics as metrics_module -from keras.engine import training as training_module -from keras.testing_infra import test_combinations +from tf_keras import layers as layers_module +from tf_keras import metrics as metrics_module +from tf_keras.engine import training as training_module +from tf_keras.testing_infra import test_combinations # isort: off from tensorflow.python.distribute import ( @@ -30,7 +30,7 @@ class ParameterServerTrainingMetricTest(test_combinations.TestCase): - """Test Parameter Server Distribution strategy with Keras Model Training""" + """Test Parameter Server Distribution strategy with TF-Keras Model Training""" @classmethod def setUpClass(cls): diff --git a/keras/integration_test/preprocessing_applied_in_dataset_creator_test.py b/tf_keras/integration_test/preprocessing_applied_in_dataset_creator_test.py similarity index 93% rename from keras/integration_test/preprocessing_applied_in_dataset_creator_test.py rename to tf_keras/integration_test/preprocessing_applied_in_dataset_creator_test.py index 3c490a1f5..4d1c5d8cf 100644 --- a/keras/integration_test/preprocessing_applied_in_dataset_creator_test.py +++ b/tf_keras/integration_test/preprocessing_applied_in_dataset_creator_test.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Demonstrate Keras preprocessing layers applied in tf.data.Dataset.map.""" +"""Demonstrate TF-Keras preprocessing layers applied in tf.data.Dataset.map.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v2 as tf -from keras.integration_test import preprocessing_test_utils as utils +from tf_keras.integration_test import preprocessing_test_utils as utils ds_combinations = tf.__internal__.distribute.combinations multi_process_runner = tf.__internal__.distribute.multi_process_runner @@ -45,7 +45,7 @@ test_combinations.combine(strategy=STRATEGIES, mode="eager") ) class PreprocessingAppliedInDatasetCreatorTest(tf.test.TestCase): - """Demonstrate Keras preprocessing layers applied in tf.data.Dataset.map.""" + """Demonstrate TF-Keras preprocessing layers applied in tf.data.Dataset.map.""" def testDistributedModelFit(self, strategy): if not tf.__internal__.tf2.enabled() and isinstance( diff --git a/keras/integration_test/preprocessing_applied_in_dataset_test.py b/tf_keras/integration_test/preprocessing_applied_in_dataset_test.py similarity index 91% rename from keras/integration_test/preprocessing_applied_in_dataset_test.py rename to tf_keras/integration_test/preprocessing_applied_in_dataset_test.py index d54f9fdef..ffda63bd0 100644 --- a/keras/integration_test/preprocessing_applied_in_dataset_test.py +++ b/tf_keras/integration_test/preprocessing_applied_in_dataset_test.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Demonstrate Keras preprocessing layers applied in tf.data.Dataset.map.""" +"""Demonstrate TF-Keras preprocessing layers applied in tf.data.Dataset.map.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v2 as tf -from keras.integration_test import preprocessing_test_utils as utils +from tf_keras.integration_test import preprocessing_test_utils as utils ds_combinations = tf.__internal__.distribute.combinations multi_process_runner = tf.__internal__.distribute.multi_process_runner @@ -45,7 +45,7 @@ test_combinations.combine(strategy=STRATEGIES, mode="eager") ) class PreprocessingAppliedInDatasetTest(tf.test.TestCase): - """Demonstrate Keras preprocessing layers applied in tf.data.Dataset.map.""" + """Demonstrate TF-Keras preprocessing layers applied in tf.data.Dataset.map.""" def testDistributedModelFit(self, strategy): with strategy.scope(): diff --git a/keras/integration_test/preprocessing_applied_in_model_test.py b/tf_keras/integration_test/preprocessing_applied_in_model_test.py similarity index 94% rename from keras/integration_test/preprocessing_applied_in_model_test.py rename to tf_keras/integration_test/preprocessing_applied_in_model_test.py index 4b1a20706..7f70c245d 100644 --- a/keras/integration_test/preprocessing_applied_in_model_test.py +++ b/tf_keras/integration_test/preprocessing_applied_in_model_test.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Demonstrate Keras preprocessing layers applied inside a Model.""" +"""Demonstrate TF-Keras preprocessing layers applied inside a Model.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v2 as tf -from keras.integration_test import preprocessing_test_utils as utils +from tf_keras.integration_test import preprocessing_test_utils as utils ds_combinations = tf.__internal__.distribute.combinations multi_process_runner = tf.__internal__.distribute.multi_process_runner @@ -46,7 +46,7 @@ test_combinations.combine(strategy=STRATEGIES, mode="eager") ) class PreprocessingAppliedInModelTest(tf.test.TestCase): - """Demonstrate Keras preprocessing layers applied inside a Model.""" + """Demonstrate TF-Keras preprocessing layers applied inside a Model.""" def testDistributedModelFit(self, strategy): if not tf.__internal__.tf2.enabled() and isinstance( diff --git a/keras/integration_test/preprocessing_test_utils.py b/tf_keras/integration_test/preprocessing_test_utils.py similarity index 98% rename from keras/integration_test/preprocessing_test_utils.py rename to tf_keras/integration_test/preprocessing_test_utils.py index 8287dc83a..754b47b3a 100644 --- a/keras/integration_test/preprocessing_test_utils.py +++ b/tf_keras/integration_test/preprocessing_test_utils.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Common utilities for our Keras preprocessing integration tests.""" +"""Common utilities for our TF-Keras preprocessing integration tests.""" import os diff --git a/keras/integration_test/py_metric_test.py b/tf_keras/integration_test/py_metric_test.py similarity index 91% rename from keras/integration_test/py_metric_test.py rename to tf_keras/integration_test/py_metric_test.py index f07f019ab..b9b35982b 100644 --- a/keras/integration_test/py_metric_test.py +++ b/tf_keras/integration_test/py_metric_test.py @@ -3,11 +3,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import Sequential -from keras import layers -from keras import losses -from keras import metrics -from keras.testing_infra import test_combinations +from tf_keras import Sequential +from tf_keras import layers +from tf_keras import losses +from tf_keras import metrics +from tf_keras.testing_infra import test_combinations def get_dataset(num_batches=5, batch_size=2): diff --git a/keras/integration_test/saved_model_test.py b/tf_keras/integration_test/saved_model_test.py similarity index 100% rename from keras/integration_test/saved_model_test.py rename to tf_keras/integration_test/saved_model_test.py diff --git a/keras/integration_test/saving_v3_test.py b/tf_keras/integration_test/saving_v3_test.py similarity index 83% rename from keras/integration_test/saving_v3_test.py rename to tf_keras/integration_test/saving_v3_test.py index de4906cba..c9ba48c10 100644 --- a/keras/integration_test/saving_v3_test.py +++ b/tf_keras/integration_test/saving_v3_test.py @@ -5,20 +5,20 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.integration_test.models import bert -from keras.integration_test.models import dcgan -from keras.integration_test.models import edge_case_model -from keras.integration_test.models import input_spec -from keras.integration_test.models import low_level_model -from keras.integration_test.models import mini_unet -from keras.integration_test.models import mini_xception -from keras.integration_test.models import retinanet -from keras.integration_test.models import structured_data_classification -from keras.integration_test.models import text_classification -from keras.integration_test.models import timeseries_forecasting -from keras.integration_test.models import vae -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras.integration_test.models import bert +from tf_keras.integration_test.models import dcgan +from tf_keras.integration_test.models import edge_case_model +from tf_keras.integration_test.models import input_spec +from tf_keras.integration_test.models import low_level_model +from tf_keras.integration_test.models import mini_unet +from tf_keras.integration_test.models import mini_xception +from tf_keras.integration_test.models import retinanet +from tf_keras.integration_test.models import structured_data_classification +from tf_keras.integration_test.models import text_classification +from tf_keras.integration_test.models import timeseries_forecasting +from tf_keras.integration_test.models import vae +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils def get_dataset(data_specs, batch_size): diff --git a/keras/integration_test/tf_trt_test.py b/tf_keras/integration_test/tf_trt_test.py similarity index 96% rename from keras/integration_test/tf_trt_test.py rename to tf_keras/integration_test/tf_trt_test.py index 93f18013e..d924557dd 100644 --- a/keras/integration_test/tf_trt_test.py +++ b/tf_keras/integration_test/tf_trt_test.py @@ -46,11 +46,11 @@ def call(self, inputs): vocab_file = os.path.join( flags.FLAGS["test_srcdir"].value, - "org_keras/keras", + "org_keras/tf_keras", "integration_test/data/sentencepiece.pb", ) # vocab_file = tf.compat.v1.test.test_src_dir_path( - # "python/keras/integration_test/data/sentencepiece.pb") + # "python/tf_keras/integration_test/data/sentencepiece.pb") output_dir = tempfile.mkdtemp(dir=self.get_temp_dir()) # Create and save a Tokenizer diff --git a/keras/integration_test/tpu_strategy_test.py b/tf_keras/integration_test/tpu_strategy_test.py similarity index 100% rename from keras/integration_test/tpu_strategy_test.py rename to tf_keras/integration_test/tpu_strategy_test.py diff --git a/keras/integration_test/vectorized_map_test.py b/tf_keras/integration_test/vectorized_map_test.py similarity index 100% rename from keras/integration_test/vectorized_map_test.py rename to tf_keras/integration_test/vectorized_map_test.py diff --git a/keras/kokoro/github/ubuntu/cpu/build.sh b/tf_keras/kokoro/github/ubuntu/cpu/build.sh similarity index 100% rename from keras/kokoro/github/ubuntu/cpu/build.sh rename to tf_keras/kokoro/github/ubuntu/cpu/build.sh diff --git a/keras/kokoro/github/ubuntu/cpu/continuous.cfg b/tf_keras/kokoro/github/ubuntu/cpu/continuous.cfg similarity index 100% rename from keras/kokoro/github/ubuntu/cpu/continuous.cfg rename to tf_keras/kokoro/github/ubuntu/cpu/continuous.cfg diff --git a/keras/kokoro/github/ubuntu/cpu/presubmit.cfg b/tf_keras/kokoro/github/ubuntu/cpu/presubmit.cfg similarity index 100% rename from keras/kokoro/github/ubuntu/cpu/presubmit.cfg rename to tf_keras/kokoro/github/ubuntu/cpu/presubmit.cfg diff --git a/keras/kokoro/github/ubuntu/gpu/build.sh b/tf_keras/kokoro/github/ubuntu/gpu/build.sh similarity index 100% rename from keras/kokoro/github/ubuntu/gpu/build.sh rename to tf_keras/kokoro/github/ubuntu/gpu/build.sh diff --git a/keras/kokoro/github/ubuntu/gpu/continuous.cfg b/tf_keras/kokoro/github/ubuntu/gpu/continuous.cfg similarity index 100% rename from keras/kokoro/github/ubuntu/gpu/continuous.cfg rename to tf_keras/kokoro/github/ubuntu/gpu/continuous.cfg diff --git a/keras/kokoro/github/ubuntu/gpu/presubmit.cfg b/tf_keras/kokoro/github/ubuntu/gpu/presubmit.cfg similarity index 100% rename from keras/kokoro/github/ubuntu/gpu/presubmit.cfg rename to tf_keras/kokoro/github/ubuntu/gpu/presubmit.cfg diff --git a/keras/layers/BUILD b/tf_keras/layers/BUILD similarity index 55% rename from keras/layers/BUILD rename to tf_keras/layers/BUILD index 4c48d7e57..1e50f4d43 100644 --- a/keras/layers/BUILD +++ b/tf_keras/layers/BUILD @@ -1,14 +1,14 @@ # Description: -# Contains the Keras layers (internal TensorFlow version). +# Contains the TF-Keras layers (internal TensorFlow version). # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], # TODO(scottzhu): Remove non-keras deps from TF. default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/tensorflow/python/distribute:__pkg__", "//third_party/tensorflow/python/feature_column:__pkg__", "//third_party/tensorflow/python/trackable:__pkg__", @@ -29,21 +29,21 @@ py_library( deps = [ ":kernelized", ":noise", - "//keras/feature_column", - "//keras/layers/activation", - "//keras/layers/attention", - "//keras/layers/convolutional", - "//keras/layers/core", - "//keras/layers/locally_connected", - "//keras/layers/merging", - "//keras/layers/normalization", - "//keras/layers/pooling", - "//keras/layers/preprocessing", - "//keras/layers/regularization", - "//keras/layers/reshaping", - "//keras/layers/rnn", - "//keras/premade_models", - "//keras/utils:tf_utils", + "//tf_keras/feature_column", + "//tf_keras/layers/activation", + "//tf_keras/layers/attention", + "//tf_keras/layers/convolutional", + "//tf_keras/layers/core", + "//tf_keras/layers/locally_connected", + "//tf_keras/layers/merging", + "//tf_keras/layers/normalization", + "//tf_keras/layers/pooling", + "//tf_keras/layers/preprocessing", + "//tf_keras/layers/regularization", + "//tf_keras/layers/reshaping", + "//tf_keras/layers/rnn", + "//tf_keras/premade_models", + "//tf_keras/utils:tf_utils", ], ) @@ -54,9 +54,9 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:base_layer", - "//keras/engine:input_spec", - "//keras/initializers", + "//tf_keras:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", ], ) @@ -65,9 +65,9 @@ py_library( srcs = ["noise.py"], srcs_version = "PY3", deps = [ - "//keras/layers/regularization:alpha_dropout", - "//keras/layers/regularization:gaussian_dropout", - "//keras/layers/regularization:gaussian_noise", + "//tf_keras/layers/regularization:alpha_dropout", + "//tf_keras/layers/regularization:gaussian_dropout", + "//tf_keras/layers/regularization:gaussian_noise", ], ) @@ -78,11 +78,11 @@ tf_py_test( python_version = "PY3", shard_count = 3, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/saving", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/saving", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -93,11 +93,11 @@ tf_py_test( python_version = "PY3", shard_count = 3, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -107,10 +107,10 @@ tf_py_test( srcs = ["serialization_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -121,13 +121,13 @@ tf_py_test( python_version = "PY3", deps = [ ":layers", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras:backend", - "//keras/initializers", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras:backend", + "//tf_keras/initializers", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/tf_keras/layers/__init__.py b/tf_keras/layers/__init__.py new file mode 100644 index 000000000..bdca9cd36 --- /dev/null +++ b/tf_keras/layers/__init__.py @@ -0,0 +1,292 @@ +# Copyright 2016 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. +# ============================================================================== +"""Keras layers API.""" + +# isort: off +import tensorflow.compat.v2 as tf + +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.base_preprocessing_layer import PreprocessingLayer + +# Generic layers. +from tf_keras.engine.input_layer import Input +from tf_keras.engine.input_layer import InputLayer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.activation.elu import ELU +from tf_keras.layers.activation.leaky_relu import LeakyReLU +from tf_keras.layers.activation.prelu import PReLU + +# Activations layers. +from tf_keras.layers.activation.relu import ReLU +from tf_keras.layers.activation.softmax import Softmax +from tf_keras.layers.activation.thresholded_relu import ThresholdedReLU +from tf_keras.layers.attention.additive_attention import AdditiveAttention +from tf_keras.layers.attention.attention import Attention + +# Attention layers. +from tf_keras.layers.attention.multi_head_attention import MultiHeadAttention + +# Convolution layer aliases. +# Convolution layers. +from tf_keras.layers.convolutional.conv1d import Conv1D +from tf_keras.layers.convolutional.conv1d import Convolution1D +from tf_keras.layers.convolutional.conv1d_transpose import Conv1DTranspose +from tf_keras.layers.convolutional.conv1d_transpose import Convolution1DTranspose +from tf_keras.layers.convolutional.conv2d import Conv2D +from tf_keras.layers.convolutional.conv2d import Convolution2D +from tf_keras.layers.convolutional.conv2d_transpose import Conv2DTranspose +from tf_keras.layers.convolutional.conv2d_transpose import Convolution2DTranspose +from tf_keras.layers.convolutional.conv3d import Conv3D +from tf_keras.layers.convolutional.conv3d import Convolution3D +from tf_keras.layers.convolutional.conv3d_transpose import Conv3DTranspose +from tf_keras.layers.convolutional.conv3d_transpose import Convolution3DTranspose +from tf_keras.layers.convolutional.depthwise_conv1d import DepthwiseConv1D +from tf_keras.layers.convolutional.depthwise_conv2d import DepthwiseConv2D +from tf_keras.layers.convolutional.separable_conv1d import SeparableConv1D +from tf_keras.layers.convolutional.separable_conv1d import SeparableConvolution1D +from tf_keras.layers.convolutional.separable_conv2d import SeparableConv2D +from tf_keras.layers.convolutional.separable_conv2d import SeparableConvolution2D + +# Core layers. +from tf_keras.layers.core.activation import Activation +from tf_keras.layers.core.dense import Dense +from tf_keras.layers.core.einsum_dense import EinsumDense +from tf_keras.layers.core.embedding import Embedding +from tf_keras.layers.core.identity import Identity +from tf_keras.layers.core.lambda_layer import Lambda +from tf_keras.layers.core.masking import Masking +from tf_keras.layers.core.tf_op_layer import ClassMethod +from tf_keras.layers.core.tf_op_layer import InstanceMethod +from tf_keras.layers.core.tf_op_layer import InstanceProperty +from tf_keras.layers.core.tf_op_layer import SlicingOpLambda +from tf_keras.layers.core.tf_op_layer import TFOpLambda + +# Locally-connected layers. +from tf_keras.layers.locally_connected.locally_connected1d import ( + LocallyConnected1D, +) +from tf_keras.layers.locally_connected.locally_connected2d import ( + LocallyConnected2D, +) + +# Merging functions. +# Merging layers. +from tf_keras.layers.merging.add import Add +from tf_keras.layers.merging.add import add +from tf_keras.layers.merging.average import Average +from tf_keras.layers.merging.average import average +from tf_keras.layers.merging.concatenate import Concatenate +from tf_keras.layers.merging.concatenate import concatenate +from tf_keras.layers.merging.dot import Dot +from tf_keras.layers.merging.dot import dot +from tf_keras.layers.merging.maximum import Maximum +from tf_keras.layers.merging.maximum import maximum +from tf_keras.layers.merging.minimum import Minimum +from tf_keras.layers.merging.minimum import minimum +from tf_keras.layers.merging.multiply import Multiply +from tf_keras.layers.merging.multiply import multiply +from tf_keras.layers.merging.subtract import Subtract +from tf_keras.layers.merging.subtract import subtract +from tf_keras.layers.normalization.batch_normalization import ( + SyncBatchNormalization, +) + +# Normalization layers. +from tf_keras.layers.normalization.group_normalization import GroupNormalization +from tf_keras.layers.normalization.layer_normalization import LayerNormalization +from tf_keras.layers.normalization.unit_normalization import UnitNormalization +from tf_keras.layers.normalization.spectral_normalization import ( + SpectralNormalization, +) # noqa: E501 + +# Preprocessing layers. +from tf_keras.layers.preprocessing.category_encoding import CategoryEncoding +from tf_keras.layers.preprocessing.discretization import Discretization +from tf_keras.layers.preprocessing.hashed_crossing import HashedCrossing +from tf_keras.layers.preprocessing.hashing import Hashing + +# Image preprocessing layers. +from tf_keras.layers.preprocessing.image_preprocessing import CenterCrop +from tf_keras.layers.preprocessing.image_preprocessing import RandomBrightness +from tf_keras.layers.preprocessing.image_preprocessing import RandomContrast +from tf_keras.layers.preprocessing.image_preprocessing import RandomCrop +from tf_keras.layers.preprocessing.image_preprocessing import RandomFlip +from tf_keras.layers.preprocessing.image_preprocessing import RandomHeight +from tf_keras.layers.preprocessing.image_preprocessing import RandomRotation +from tf_keras.layers.preprocessing.image_preprocessing import RandomTranslation +from tf_keras.layers.preprocessing.image_preprocessing import RandomWidth +from tf_keras.layers.preprocessing.image_preprocessing import RandomZoom +from tf_keras.layers.preprocessing.image_preprocessing import Rescaling +from tf_keras.layers.preprocessing.image_preprocessing import Resizing +from tf_keras.layers.preprocessing.integer_lookup import IntegerLookup +from tf_keras.layers.preprocessing.normalization import Normalization +from tf_keras.layers.preprocessing.string_lookup import StringLookup +from tf_keras.layers.preprocessing.text_vectorization import TextVectorization +from tf_keras.layers.regularization.activity_regularization import ( + ActivityRegularization, +) +from tf_keras.layers.regularization.alpha_dropout import AlphaDropout + +# Regularization layers. +from tf_keras.layers.regularization.dropout import Dropout +from tf_keras.layers.regularization.gaussian_dropout import GaussianDropout +from tf_keras.layers.regularization.gaussian_noise import GaussianNoise +from tf_keras.layers.regularization.spatial_dropout1d import SpatialDropout1D +from tf_keras.layers.regularization.spatial_dropout2d import SpatialDropout2D +from tf_keras.layers.regularization.spatial_dropout3d import SpatialDropout3D + +# Reshaping layers. +from tf_keras.layers.reshaping.cropping1d import Cropping1D +from tf_keras.layers.reshaping.cropping2d import Cropping2D +from tf_keras.layers.reshaping.cropping3d import Cropping3D +from tf_keras.layers.reshaping.flatten import Flatten +from tf_keras.layers.reshaping.permute import Permute +from tf_keras.layers.reshaping.repeat_vector import RepeatVector +from tf_keras.layers.reshaping.reshape import Reshape +from tf_keras.layers.reshaping.up_sampling1d import UpSampling1D +from tf_keras.layers.reshaping.up_sampling2d import UpSampling2D +from tf_keras.layers.reshaping.up_sampling3d import UpSampling3D +from tf_keras.layers.reshaping.zero_padding1d import ZeroPadding1D +from tf_keras.layers.reshaping.zero_padding2d import ZeroPadding2D +from tf_keras.layers.reshaping.zero_padding3d import ZeroPadding3D + +if tf.__internal__.tf2.enabled(): + from tf_keras.layers.normalization.batch_normalization import ( + BatchNormalization, + ) + from tf_keras.layers.normalization.batch_normalization_v1 import ( + BatchNormalization as BatchNormalizationV1, + ) + + BatchNormalizationV2 = BatchNormalization +else: + from tf_keras.layers.normalization.batch_normalization import ( + BatchNormalization as BatchNormalizationV2, + ) + from tf_keras.layers.normalization.batch_normalization_v1 import ( + BatchNormalization, + ) + + BatchNormalizationV1 = BatchNormalization + +# Kernelized layers. +from tf_keras.layers.kernelized import RandomFourierFeatures + +# Pooling layer aliases. +# Pooling layers. +from tf_keras.layers.pooling.average_pooling1d import AveragePooling1D +from tf_keras.layers.pooling.average_pooling1d import AvgPool1D +from tf_keras.layers.pooling.average_pooling2d import AveragePooling2D +from tf_keras.layers.pooling.average_pooling2d import AvgPool2D +from tf_keras.layers.pooling.average_pooling3d import AveragePooling3D +from tf_keras.layers.pooling.average_pooling3d import AvgPool3D +from tf_keras.layers.pooling.global_average_pooling1d import GlobalAveragePooling1D +from tf_keras.layers.pooling.global_average_pooling1d import GlobalAvgPool1D +from tf_keras.layers.pooling.global_average_pooling2d import GlobalAveragePooling2D +from tf_keras.layers.pooling.global_average_pooling2d import GlobalAvgPool2D +from tf_keras.layers.pooling.global_average_pooling3d import GlobalAveragePooling3D +from tf_keras.layers.pooling.global_average_pooling3d import GlobalAvgPool3D +from tf_keras.layers.pooling.global_max_pooling1d import GlobalMaxPool1D +from tf_keras.layers.pooling.global_max_pooling1d import GlobalMaxPooling1D +from tf_keras.layers.pooling.global_max_pooling2d import GlobalMaxPool2D +from tf_keras.layers.pooling.global_max_pooling2d import GlobalMaxPooling2D +from tf_keras.layers.pooling.global_max_pooling3d import GlobalMaxPool3D +from tf_keras.layers.pooling.global_max_pooling3d import GlobalMaxPooling3D +from tf_keras.layers.pooling.max_pooling1d import MaxPool1D +from tf_keras.layers.pooling.max_pooling1d import MaxPooling1D +from tf_keras.layers.pooling.max_pooling2d import MaxPool2D +from tf_keras.layers.pooling.max_pooling2d import MaxPooling2D +from tf_keras.layers.pooling.max_pooling3d import MaxPool3D +from tf_keras.layers.pooling.max_pooling3d import MaxPooling3D +from tf_keras.layers.rnn.abstract_rnn_cell import AbstractRNNCell + +# Recurrent layers. +from tf_keras.layers.rnn.base_rnn import RNN +from tf_keras.layers.rnn.simple_rnn import SimpleRNN +from tf_keras.layers.rnn.simple_rnn import SimpleRNNCell +from tf_keras.layers.rnn.stacked_rnn_cells import StackedRNNCells + +if tf.__internal__.tf2.enabled(): + from tf_keras.layers.rnn.gru import GRU + from tf_keras.layers.rnn.gru import GRUCell + from tf_keras.layers.rnn.gru_v1 import GRU as GRUV1 + from tf_keras.layers.rnn.gru_v1 import GRUCell as GRUCellV1 + from tf_keras.layers.rnn.lstm import LSTM + from tf_keras.layers.rnn.lstm import LSTMCell + from tf_keras.layers.rnn.lstm_v1 import LSTM as LSTMV1 + from tf_keras.layers.rnn.lstm_v1 import LSTMCell as LSTMCellV1 + + GRUV2 = GRU + GRUCellV2 = GRUCell + LSTMV2 = LSTM + LSTMCellV2 = LSTMCell +else: + from tf_keras.layers.rnn.gru import GRU as GRUV2 + from tf_keras.layers.rnn.gru import GRUCell as GRUCellV2 + from tf_keras.layers.rnn.gru_v1 import GRU + from tf_keras.layers.rnn.gru_v1 import GRUCell + from tf_keras.layers.rnn.lstm import LSTM as LSTMV2 + from tf_keras.layers.rnn.lstm import LSTMCell as LSTMCellV2 + from tf_keras.layers.rnn.lstm_v1 import LSTM + from tf_keras.layers.rnn.lstm_v1 import LSTMCell + + GRUV1 = GRU + GRUCellV1 = GRUCell + LSTMV1 = LSTM + LSTMCellV1 = LSTMCell + +# Serialization functions. +from tf_keras.layers import serialization + +# Wrapper functions. +from tf_keras.layers.rnn.base_wrapper import Wrapper +from tf_keras.layers.rnn.bidirectional import Bidirectional + +# RNN Cell wrappers. +from tf_keras.layers.rnn.cell_wrappers import DeviceWrapper +from tf_keras.layers.rnn.cell_wrappers import DropoutWrapper +from tf_keras.layers.rnn.cell_wrappers import ResidualWrapper + +# Convolutional-recurrent layers. +from tf_keras.layers.rnn.conv_lstm1d import ConvLSTM1D +from tf_keras.layers.rnn.conv_lstm2d import ConvLSTM2D +from tf_keras.layers.rnn.conv_lstm3d import ConvLSTM3D +from tf_keras.layers.rnn.cudnn_gru import CuDNNGRU + +# cuDNN recurrent layers. +from tf_keras.layers.rnn.cudnn_lstm import CuDNNLSTM +from tf_keras.layers.rnn.time_distributed import TimeDistributed +from tf_keras.layers.serialization import deserialize +from tf_keras.layers.serialization import deserialize_from_json +from tf_keras.layers.serialization import get_builtin_layer +from tf_keras.layers.serialization import serialize + + +class VersionAwareLayers: + """Utility to be used internally to access layers in a V1/V2-aware fashion. + + When using layers within the TF-Keras codebase, under the constraint that + e.g. `layers.BatchNormalization` should be the `BatchNormalization` version + corresponding to the current runtime (TF1 or TF2), do not simply access + `layers.BatchNormalization` since it would ignore e.g. an early + `compat.v2.disable_v2_behavior()` call. Instead, use an instance + of `VersionAwareLayers` (which you can use just like the `layers` module). + """ + + def __getattr__(self, name): + serialization.populate_deserializable_objects() + if name in serialization.LOCAL.ALL_OBJECTS: + return serialization.LOCAL.ALL_OBJECTS[name] + return super().__getattr__(name) diff --git a/keras/layers/activation/BUILD b/tf_keras/layers/activation/BUILD similarity index 56% rename from keras/layers/activation/BUILD rename to tf_keras/layers/activation/BUILD index 2b81f4897..c2707dbb0 100644 --- a/keras/layers/activation/BUILD +++ b/tf_keras/layers/activation/BUILD @@ -1,13 +1,13 @@ # Description: -# Contains the Keras activation layers. +# Contains the TF-Keras activation layers. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", ], licenses = ["notice"], ) @@ -33,9 +33,9 @@ py_library( srcs = ["relu.py"], srcs_version = "PY3", deps = [ - "//keras:backend", - "//keras/engine:base_layer", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/utils:tf_utils", ], ) @@ -45,9 +45,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/utils:tf_utils", ], ) @@ -56,9 +56,9 @@ py_library( srcs = ["leaky_relu.py"], srcs_version = "PY3", deps = [ - "//keras:backend", - "//keras/engine:base_layer", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/utils:tf_utils", ], ) @@ -67,13 +67,13 @@ py_library( srcs = ["prelu.py"], srcs_version = "PY3", deps = [ - "//keras:backend", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/initializers", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + "//tf_keras/utils:tf_utils", ], ) @@ -82,9 +82,9 @@ py_library( srcs = ["elu.py"], srcs_version = "PY3", deps = [ - "//keras:backend", - "//keras/engine:base_layer", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/utils:tf_utils", ], ) @@ -94,9 +94,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/utils:tf_utils", ], ) @@ -108,9 +108,9 @@ tf_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -121,9 +121,9 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -134,9 +134,9 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -147,9 +147,9 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -160,9 +160,9 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -173,8 +173,8 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) diff --git a/keras/layers/activation/__init__.py b/tf_keras/layers/activation/__init__.py similarity index 68% rename from keras/layers/activation/__init__.py rename to tf_keras/layers/activation/__init__.py index f57176275..339dcf5a6 100644 --- a/keras/layers/activation/__init__.py +++ b/tf_keras/layers/activation/__init__.py @@ -15,9 +15,9 @@ """Layers that act as activation functions.""" -from keras.layers.activation.elu import ELU -from keras.layers.activation.leaky_relu import LeakyReLU -from keras.layers.activation.prelu import PReLU -from keras.layers.activation.relu import ReLU -from keras.layers.activation.softmax import Softmax -from keras.layers.activation.thresholded_relu import ThresholdedReLU +from tf_keras.layers.activation.elu import ELU +from tf_keras.layers.activation.leaky_relu import LeakyReLU +from tf_keras.layers.activation.prelu import PReLU +from tf_keras.layers.activation.relu import ReLU +from tf_keras.layers.activation.softmax import Softmax +from tf_keras.layers.activation.thresholded_relu import ThresholdedReLU diff --git a/keras/layers/activation/elu.py b/tf_keras/layers/activation/elu.py similarity index 94% rename from keras/layers/activation/elu.py rename to tf_keras/layers/activation/elu.py index 8bba10fb7..e794804d4 100644 --- a/keras/layers/activation/elu.py +++ b/tf_keras/layers/activation/elu.py @@ -15,9 +15,9 @@ """Exponential Linear Unit activation layer.""" -from keras import backend -from keras.engine.base_layer import Layer -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/activation/elu_test.py b/tf_keras/layers/activation/elu_test.py similarity index 92% rename from keras/layers/activation/elu_test.py rename to tf_keras/layers/activation/elu_test.py index 63f20d12b..dbf73cedd 100644 --- a/keras/layers/activation/elu_test.py +++ b/tf_keras/layers/activation/elu_test.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/activation/leaky_relu.py b/tf_keras/layers/activation/leaky_relu.py similarity index 95% rename from keras/layers/activation/leaky_relu.py rename to tf_keras/layers/activation/leaky_relu.py index fa3e373d7..761a1c0a1 100644 --- a/keras/layers/activation/leaky_relu.py +++ b/tf_keras/layers/activation/leaky_relu.py @@ -15,9 +15,9 @@ """Leaky version of a Rectified Linear Unit activation layer.""" -from keras import backend -from keras.engine.base_layer import Layer -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/activation/leaky_relu_test.py b/tf_keras/layers/activation/leaky_relu_test.py similarity index 93% rename from keras/layers/activation/leaky_relu_test.py rename to tf_keras/layers/activation/leaky_relu_test.py index 13d25699b..84f2028c7 100644 --- a/keras/layers/activation/leaky_relu_test.py +++ b/tf_keras/layers/activation/leaky_relu_test.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/activation/prelu.py b/tf_keras/layers/activation/prelu.py similarity index 94% rename from keras/layers/activation/prelu.py rename to tf_keras/layers/activation/prelu.py index 09164599d..d3d6384ef 100644 --- a/keras/layers/activation/prelu.py +++ b/tf_keras/layers/activation/prelu.py @@ -15,13 +15,13 @@ """Parametric Rectified Linear Unit activation layer.""" -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/activation/prelu_test.py b/tf_keras/layers/activation/prelu_test.py similarity index 91% rename from keras/layers/activation/prelu_test.py rename to tf_keras/layers/activation/prelu_test.py index 0d07f3aa9..7f1b2489b 100644 --- a/keras/layers/activation/prelu_test.py +++ b/tf_keras/layers/activation/prelu_test.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/activation/relu.py b/tf_keras/layers/activation/relu.py similarity index 97% rename from keras/layers/activation/relu.py rename to tf_keras/layers/activation/relu.py index dbb5f2194..27fb9a485 100644 --- a/keras/layers/activation/relu.py +++ b/tf_keras/layers/activation/relu.py @@ -15,9 +15,9 @@ """Rectified Linear Unit activation layer.""" -from keras import backend -from keras.engine.base_layer import Layer -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/activation/relu_test.py b/tf_keras/layers/activation/relu_test.py similarity index 97% rename from keras/layers/activation/relu_test.py rename to tf_keras/layers/activation/relu_test.py index 70ded1627..8563688e5 100644 --- a/keras/layers/activation/relu_test.py +++ b/tf_keras/layers/activation/relu_test.py @@ -17,9 +17,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/activation/softmax.py b/tf_keras/layers/activation/softmax.py similarity index 97% rename from keras/layers/activation/softmax.py rename to tf_keras/layers/activation/softmax.py index aed2dbdec..cd4785b7e 100644 --- a/keras/layers/activation/softmax.py +++ b/tf_keras/layers/activation/softmax.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/activation/softmax_test.py b/tf_keras/layers/activation/softmax_test.py similarity index 89% rename from keras/layers/activation/softmax_test.py rename to tf_keras/layers/activation/softmax_test.py index 86562425d..e346d3795 100644 --- a/keras/layers/activation/softmax_test.py +++ b/tf_keras/layers/activation/softmax_test.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/activation/thresholded_relu.py b/tf_keras/layers/activation/thresholded_relu.py similarity index 95% rename from keras/layers/activation/thresholded_relu.py rename to tf_keras/layers/activation/thresholded_relu.py index 9d575af1e..a3ce6a18d 100644 --- a/keras/layers/activation/thresholded_relu.py +++ b/tf_keras/layers/activation/thresholded_relu.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/activation/thresholded_relu_test.py b/tf_keras/layers/activation/thresholded_relu_test.py similarity index 94% rename from keras/layers/activation/thresholded_relu_test.py rename to tf_keras/layers/activation/thresholded_relu_test.py index f7f4170a4..be0dc054f 100644 --- a/keras/layers/activation/thresholded_relu_test.py +++ b/tf_keras/layers/activation/thresholded_relu_test.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/attention/BUILD b/tf_keras/layers/attention/BUILD similarity index 65% rename from keras/layers/attention/BUILD rename to tf_keras/layers/attention/BUILD index fffdb146f..ad1e35bc1 100644 --- a/keras/layers/attention/BUILD +++ b/tf_keras/layers/attention/BUILD @@ -1,13 +1,13 @@ # Description: -# Contains the Keras attention layers. +# Contains the TF-Keras attention layers. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/py/tensorflow_gnn:__subpackages__", "//third_party/tensorflow/python/distribute:__pkg__", "//third_party/tensorflow/python/feature_column:__pkg__", @@ -38,14 +38,14 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:base_layer", - "//keras/initializers", - "//keras/layers/activation", - "//keras/layers/core", - "//keras/layers/regularization", - "//keras/utils:tf_utils", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:base_layer", + "//tf_keras/initializers", + "//tf_keras/layers/activation", + "//tf_keras/layers/core", + "//tf_keras/layers/regularization", + "//tf_keras/utils:tf_utils", ], ) @@ -55,9 +55,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras:base_layer", - "//keras/utils:control_flow_util", + "//tf_keras:backend", + "//tf_keras:base_layer", + "//tf_keras/utils:control_flow_util", ], ) @@ -86,11 +86,11 @@ tf_py_test( srcs = ["multi_head_attention_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -101,11 +101,11 @@ tf_py_test( python_version = "PY3", deps = [ ":base_dense_attention", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -115,12 +115,12 @@ tf_py_test( srcs = ["attention_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/layers/core", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/layers/core", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -130,12 +130,12 @@ tf_py_test( srcs = ["additive_attention_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/mixed_precision:policy", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/mixed_precision:policy", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) diff --git a/keras/layers/attention/__init__.py b/tf_keras/layers/attention/__init__.py similarity index 77% rename from keras/layers/attention/__init__.py rename to tf_keras/layers/attention/__init__.py index e285718b4..6bb17b5cb 100644 --- a/keras/layers/attention/__init__.py +++ b/tf_keras/layers/attention/__init__.py @@ -15,6 +15,6 @@ """Keras attention layers.""" -from keras.layers.attention.additive_attention import AdditiveAttention -from keras.layers.attention.attention import Attention -from keras.layers.attention.multi_head_attention import MultiHeadAttention +from tf_keras.layers.attention.additive_attention import AdditiveAttention +from tf_keras.layers.attention.attention import Attention +from tf_keras.layers.attention.multi_head_attention import MultiHeadAttention diff --git a/keras/layers/attention/additive_attention.py b/tf_keras/layers/attention/additive_attention.py similarity index 98% rename from keras/layers/attention/additive_attention.py rename to tf_keras/layers/attention/additive_attention.py index 49b826c11..58b50eff8 100644 --- a/keras/layers/attention/additive_attention.py +++ b/tf_keras/layers/attention/additive_attention.py @@ -21,7 +21,7 @@ import tensorflow.compat.v2 as tf -from keras.layers.attention.base_dense_attention import BaseDenseAttention +from tf_keras.layers.attention.base_dense_attention import BaseDenseAttention # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/attention/additive_attention_test.py b/tf_keras/layers/attention/additive_attention_test.py similarity index 98% rename from keras/layers/attention/additive_attention_test.py rename to tf_keras/layers/attention/additive_attention_test.py index 690053bcf..b38bb2398 100644 --- a/keras/layers/attention/additive_attention_test.py +++ b/tf_keras/layers/attention/additive_attention_test.py @@ -18,10 +18,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.mixed_precision import policy -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.mixed_precision import policy +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/layers/attention/attention.py b/tf_keras/layers/attention/attention.py similarity index 99% rename from keras/layers/attention/attention.py rename to tf_keras/layers/attention/attention.py index 380c2f557..d4604a1b0 100644 --- a/keras/layers/attention/attention.py +++ b/tf_keras/layers/attention/attention.py @@ -21,7 +21,7 @@ import tensorflow.compat.v2 as tf -from keras.layers.attention.base_dense_attention import BaseDenseAttention +from tf_keras.layers.attention.base_dense_attention import BaseDenseAttention # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/attention/attention_test.py b/tf_keras/layers/attention/attention_test.py similarity index 99% rename from keras/layers/attention/attention_test.py rename to tf_keras/layers/attention/attention_test.py index 43debfb26..f07d411c1 100644 --- a/keras/layers/attention/attention_test.py +++ b/tf_keras/layers/attention/attention_test.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers import core -from keras.testing_infra import test_combinations +import tf_keras as keras +from tf_keras.layers import core +from tf_keras.testing_infra import test_combinations @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/layers/attention/base_dense_attention.py b/tf_keras/layers/attention/base_dense_attention.py similarity index 98% rename from keras/layers/attention/base_dense_attention.py rename to tf_keras/layers/attention/base_dense_attention.py index c51907465..7a22a1167 100644 --- a/keras/layers/attention/base_dense_attention.py +++ b/tf_keras/layers/attention/base_dense_attention.py @@ -21,9 +21,9 @@ import tensorflow.compat.v2 as tf from absl import logging -from keras import backend -from keras.engine import base_layer -from keras.utils import control_flow_util +from tf_keras import backend +from tf_keras.engine import base_layer +from tf_keras.utils import control_flow_util # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/attention/base_dense_attention_test.py b/tf_keras/layers/attention/base_dense_attention_test.py similarity index 97% rename from keras/layers/attention/base_dense_attention_test.py rename to tf_keras/layers/attention/base_dense_attention_test.py index 86b9f4b05..403bb2ea0 100644 --- a/keras/layers/attention/base_dense_attention_test.py +++ b/tf_keras/layers/attention/base_dense_attention_test.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.layers.attention.base_dense_attention import BaseDenseAttention -from keras.layers.attention.base_dense_attention import _lower_triangular_mask -from keras.testing_infra import test_combinations +from tf_keras.layers.attention.base_dense_attention import BaseDenseAttention +from tf_keras.layers.attention.base_dense_attention import _lower_triangular_mask +from tf_keras.testing_infra import test_combinations @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/layers/attention/multi_head_attention.py b/tf_keras/layers/attention/multi_head_attention.py similarity index 98% rename from keras/layers/attention/multi_head_attention.py rename to tf_keras/layers/attention/multi_head_attention.py index e2b5fc3d7..056010c1e 100644 --- a/keras/layers/attention/multi_head_attention.py +++ b/tf_keras/layers/attention/multi_head_attention.py @@ -22,14 +22,14 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine.base_layer import Layer -from keras.layers import activation -from keras.layers import core -from keras.layers import regularization -from keras.utils import tf_utils +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine.base_layer import Layer +from tf_keras.layers import activation +from tf_keras.layers import core +from tf_keras.layers import regularization +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -304,7 +304,7 @@ def get_config(self): @classmethod def from_config(cls, config): - # If the layer has a different build() function from the Keras default, + # If the layer has a different build() function from the TF-Keras default, # we need to trigger the customized build to create weights. query_shape = config.pop("query_shape") key_shape = config.pop("key_shape") @@ -614,7 +614,7 @@ def call( def _compute_attention_mask( self, query, value, key=None, attention_mask=None, use_causal_mask=False ): - """Computes the attention mask, using the Keras masks of the inputs. + """Computes the attention mask, using the TF-Keras masks of the inputs. * The `query`'s mask is reshaped from [B, T] to [B, T, 1]. * The `value`'s mask is reshaped from [B, S] to [B, 1, S]. @@ -640,7 +640,7 @@ def _compute_attention_mask( Returns: attention_mask: a boolean mask of shape `(B, T, S)`, that prevents - attention to certain positions, based on the Keras masks of the + attention to certain positions, based on the TF-Keras masks of the `query`, `key`, `value`, and `attention_mask` tensors, and the causal mask if `use_causal_mask=True`. """ diff --git a/keras/layers/attention/multi_head_attention_test.py b/tf_keras/layers/attention/multi_head_attention_test.py similarity index 99% rename from keras/layers/attention/multi_head_attention_test.py rename to tf_keras/layers/attention/multi_head_attention_test.py index aa4d15aed..ea26b93eb 100644 --- a/keras/layers/attention/multi_head_attention_test.py +++ b/tf_keras/layers/attention/multi_head_attention_test.py @@ -18,10 +18,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.saving import object_registration -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.saving import object_registration +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # This decorator runs the test in V1, V2-Eager, and V2-Functional mode. It diff --git a/tf_keras/layers/convolutional/BUILD b/tf_keras/layers/convolutional/BUILD new file mode 100644 index 000000000..09fb760ff --- /dev/null +++ b/tf_keras/layers/convolutional/BUILD @@ -0,0 +1,307 @@ +# Description: +# Contains the TF-Keras convolution layers. + +# Placeholder: load unaliased py_library +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") + +package( + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], + default_visibility = [ + "//tf_keras:__subpackages__", + "//third_party/tensorflow/python/distribute:__pkg__", + "//third_party/tensorflow/python/feature_column:__pkg__", + "//third_party/tensorflow/python/trackable:__pkg__", + "//third_party/tensorflow/tools/pip_package:__pkg__", + "//third_party/tensorflow_models/official/projects/residual_mobilenet/modeling/backbones:__pkg__", + ], + licenses = ["notice"], +) + +py_library( + name = "convolutional", + srcs = [ + "__init__.py", + ], + srcs_version = "PY3", + deps = [ + ":conv1d", + ":conv1d_transpose", + ":conv2d", + ":conv2d_transpose", + ":conv3d", + ":conv3d_transpose", + ":depthwise_conv1d", + ":depthwise_conv2d", + ":separable_conv1d", + ":separable_conv2d", + "//tf_keras/layers/pooling:average_pooling1d", + "//tf_keras/layers/pooling:average_pooling2d", + "//tf_keras/layers/pooling:average_pooling3d", + "//tf_keras/layers/pooling:max_pooling1d", + "//tf_keras/layers/pooling:max_pooling2d", + "//tf_keras/layers/pooling:max_pooling3d", + "//tf_keras/layers/reshaping:cropping1d", + "//tf_keras/layers/reshaping:cropping2d", + "//tf_keras/layers/reshaping:cropping3d", + "//tf_keras/layers/reshaping:up_sampling1d", + "//tf_keras/layers/reshaping:up_sampling2d", + "//tf_keras/layers/reshaping:up_sampling3d", + "//tf_keras/layers/reshaping:zero_padding1d", + "//tf_keras/layers/reshaping:zero_padding2d", + "//tf_keras/layers/reshaping:zero_padding3d", + ], +) + +py_library( + name = "base_conv", + srcs = ["base_conv.py"], + srcs_version = "PY3", + deps = [ + "//:expect_tensorflow_installed", + "//tf_keras:activations", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + "//tf_keras/utils:engine_utils", + ], +) + +py_library( + name = "conv1d", + srcs = ["conv1d.py"], + srcs_version = "PY3", + deps = [ + ":base_conv", + "//tf_keras:activations", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/dtensor:utils", + "//tf_keras/initializers", + ], +) + +py_library( + name = "conv2d", + srcs = ["conv2d.py"], + srcs_version = "PY3", + deps = [ + ":base_conv", + "//tf_keras:activations", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/dtensor:utils", + "//tf_keras/initializers", + ], +) + +py_library( + name = "conv3d", + srcs = ["conv3d.py"], + srcs_version = "PY3", + deps = [ + ":base_conv", + "//tf_keras:activations", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/dtensor:utils", + "//tf_keras/initializers", + ], +) + +py_library( + name = "conv1d_transpose", + srcs = ["conv1d_transpose.py"], + srcs_version = "PY3", + deps = [ + ":conv1d", + "//:expect_tensorflow_installed", + "//tf_keras:activations", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/dtensor:utils", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + "//tf_keras/utils:engine_utils", + ], +) + +py_library( + name = "conv2d_transpose", + srcs = ["conv2d_transpose.py"], + srcs_version = "PY3", + deps = [ + ":conv2d", + "//:expect_tensorflow_installed", + "//tf_keras:activations", + "//tf_keras:backend", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/dtensor:utils", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + "//tf_keras/utils:engine_utils", + ], +) + +py_library( + name = "conv3d_transpose", + srcs = ["conv3d_transpose.py"], + srcs_version = "PY3", + deps = [ + ":conv3d", + "//:expect_tensorflow_installed", + "//tf_keras:activations", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/dtensor:utils", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + "//tf_keras/utils:engine_utils", + ], +) + +py_library( + name = "base_separable_conv", + srcs = ["base_separable_conv.py"], + srcs_version = "PY3", + deps = [ + ":base_conv", + "//:expect_tensorflow_installed", + "//tf_keras:activations", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + ], +) + +py_library( + name = "separable_conv1d", + srcs = ["separable_conv1d.py"], + srcs_version = "PY3", + deps = [ + ":base_separable_conv", + "//:expect_tensorflow_installed", + "//tf_keras:activations", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/initializers", + "//tf_keras/utils:engine_utils", + ], +) + +py_library( + name = "separable_conv2d", + srcs = ["separable_conv2d.py"], + srcs_version = "PY3", + deps = [ + ":base_separable_conv", + "//:expect_tensorflow_installed", + "//tf_keras:activations", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/initializers", + "//tf_keras/utils:engine_utils", + ], +) + +py_library( + name = "base_depthwise_conv", + srcs = ["base_depthwise_conv.py"], + srcs_version = "PY3", + deps = [ + ":base_conv", + "//:expect_tensorflow_installed", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + ], +) + +py_library( + name = "depthwise_conv1d", + srcs = ["depthwise_conv1d.py"], + srcs_version = "PY3", + deps = [ + ":base_depthwise_conv", + "//:expect_tensorflow_installed", + "//tf_keras/utils:engine_utils", + "//tf_keras/utils:tf_utils", + ], +) + +py_library( + name = "depthwise_conv2d", + srcs = ["depthwise_conv2d.py"], + srcs_version = "PY3", + deps = [ + ":base_depthwise_conv", + "//tf_keras:backend", + "//tf_keras/utils:engine_utils", + "//tf_keras/utils:tf_utils", + ], +) + +cuda_py_test( + name = "conv_test", + size = "medium", + srcs = ["conv_test.py"], + python_version = "PY3", + shard_count = 8, + deps = [ + "//:expect_absl_installed", # absl/testing:parameterized + "//:expect_numpy_installed", + "//:expect_tensorflow_installed", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + ], +) + +cuda_py_test( + name = "conv_transpose_test", + size = "medium", + srcs = ["conv_transpose_test.py"], + python_version = "PY3", + deps = [ + "//:expect_absl_installed", # absl/testing:parameterized + "//:expect_numpy_installed", + "//:expect_tensorflow_installed", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + ], +) + +cuda_py_test( + name = "depthwise_conv_test", + size = "medium", + srcs = ["depthwise_conv_test.py"], + python_version = "PY3", + shard_count = 8, + deps = [ + "//:expect_absl_installed", # absl/testing:parameterized + "//:expect_tensorflow_installed", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + ], +) + +cuda_py_test( + name = "separable_conv_test", + size = "medium", + srcs = ["separable_conv_test.py"], + python_version = "PY3", + deps = [ + "//:expect_absl_installed", # absl/testing:parameterized + "//:expect_numpy_installed", + "//:expect_tensorflow_installed", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + ], +) diff --git a/tf_keras/layers/convolutional/__init__.py b/tf_keras/layers/convolutional/__init__.py new file mode 100644 index 000000000..f9bf46c2e --- /dev/null +++ b/tf_keras/layers/convolutional/__init__.py @@ -0,0 +1,56 @@ +# 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. +# ============================================================================== +"""Keras convolution layers.""" + + +# Convolution layer aliases. +# Convolution layers. +from tf_keras.layers.convolutional.conv1d import Conv1D +from tf_keras.layers.convolutional.conv1d import Convolution1D +from tf_keras.layers.convolutional.conv1d_transpose import Conv1DTranspose +from tf_keras.layers.convolutional.conv1d_transpose import Convolution1DTranspose +from tf_keras.layers.convolutional.conv2d import Conv2D +from tf_keras.layers.convolutional.conv2d import Convolution2D +from tf_keras.layers.convolutional.conv2d_transpose import Conv2DTranspose +from tf_keras.layers.convolutional.conv2d_transpose import Convolution2DTranspose +from tf_keras.layers.convolutional.conv3d import Conv3D +from tf_keras.layers.convolutional.conv3d import Convolution3D +from tf_keras.layers.convolutional.conv3d_transpose import Conv3DTranspose +from tf_keras.layers.convolutional.conv3d_transpose import Convolution3DTranspose +from tf_keras.layers.convolutional.depthwise_conv1d import DepthwiseConv1D +from tf_keras.layers.convolutional.depthwise_conv2d import DepthwiseConv2D +from tf_keras.layers.convolutional.separable_conv1d import SeparableConv1D +from tf_keras.layers.convolutional.separable_conv1d import SeparableConvolution1D +from tf_keras.layers.convolutional.separable_conv2d import SeparableConv2D +from tf_keras.layers.convolutional.separable_conv2d import SeparableConvolution2D + +# Pooling layers imported for backwards namespace compatibility. +from tf_keras.layers.pooling.average_pooling1d import AveragePooling1D +from tf_keras.layers.pooling.average_pooling2d import AveragePooling2D +from tf_keras.layers.pooling.average_pooling3d import AveragePooling3D +from tf_keras.layers.pooling.max_pooling1d import MaxPooling1D +from tf_keras.layers.pooling.max_pooling2d import MaxPooling2D +from tf_keras.layers.pooling.max_pooling3d import MaxPooling3D + +# Reshaping layers imported for backwards namespace compatibility +from tf_keras.layers.reshaping.cropping1d import Cropping1D +from tf_keras.layers.reshaping.cropping2d import Cropping2D +from tf_keras.layers.reshaping.cropping3d import Cropping3D +from tf_keras.layers.reshaping.up_sampling1d import UpSampling1D +from tf_keras.layers.reshaping.up_sampling2d import UpSampling2D +from tf_keras.layers.reshaping.up_sampling3d import UpSampling3D +from tf_keras.layers.reshaping.zero_padding1d import ZeroPadding1D +from tf_keras.layers.reshaping.zero_padding2d import ZeroPadding2D +from tf_keras.layers.reshaping.zero_padding3d import ZeroPadding3D diff --git a/keras/layers/convolutional/base_conv.py b/tf_keras/layers/convolutional/base_conv.py similarity index 97% rename from keras/layers/convolutional/base_conv.py rename to tf_keras/layers/convolutional/base_conv.py index da5613cd6..f29bbe884 100644 --- a/keras/layers/convolutional/base_conv.py +++ b/tf_keras/layers/convolutional/base_conv.py @@ -17,13 +17,13 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras import activations +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils class Conv(Layer): @@ -186,8 +186,8 @@ def _validate_init(self): if self.padding == "causal": - from keras.layers.convolutional.conv1d import Conv1D - from keras.layers.convolutional.separable_conv1d import ( + from tf_keras.layers.convolutional.conv1d import Conv1D + from tf_keras.layers.convolutional.separable_conv1d import ( SeparableConv1D, ) diff --git a/keras/layers/convolutional/base_depthwise_conv.py b/tf_keras/layers/convolutional/base_depthwise_conv.py similarity index 97% rename from keras/layers/convolutional/base_depthwise_conv.py rename to tf_keras/layers/convolutional/base_depthwise_conv.py index f18c25ee8..497289e95 100644 --- a/keras/layers/convolutional/base_depthwise_conv.py +++ b/tf_keras/layers/convolutional/base_depthwise_conv.py @@ -17,11 +17,11 @@ import tensorflow.compat.v2 as tf -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine.input_spec import InputSpec -from keras.layers.convolutional.base_conv import Conv +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.convolutional.base_conv import Conv class DepthwiseConv(Conv): @@ -66,7 +66,7 @@ class DepthwiseConv(Conv): `channels_last` corresponds to inputs with shape `(batch_size, height, width, channels)` while `channels_first` corresponds to inputs with shape `(batch_size, channels, height, width)`. If left unspecified, - uses `image_data_format` value found in your Keras config file at + uses `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. dilation_rate: An integer or tuple/list of 2 integers, specifying the diff --git a/keras/layers/convolutional/base_separable_conv.py b/tf_keras/layers/convolutional/base_separable_conv.py similarity index 97% rename from keras/layers/convolutional/base_separable_conv.py rename to tf_keras/layers/convolutional/base_separable_conv.py index 6afb16103..d1a81b2cc 100644 --- a/keras/layers/convolutional/base_separable_conv.py +++ b/tf_keras/layers/convolutional/base_separable_conv.py @@ -17,12 +17,12 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine.input_spec import InputSpec -from keras.layers.convolutional.base_conv import Conv +from tf_keras import activations +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.convolutional.base_conv import Conv class SeparableConv(Conv): diff --git a/keras/layers/convolutional/conv1d.py b/tf_keras/layers/convolutional/conv1d.py similarity index 97% rename from keras/layers/convolutional/conv1d.py rename to tf_keras/layers/convolutional/conv1d.py index 5577fca94..c8cae794c 100644 --- a/keras/layers/convolutional/conv1d.py +++ b/tf_keras/layers/convolutional/conv1d.py @@ -15,12 +15,12 @@ """Keras 1D convolution layer.""" -from keras import activations -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.dtensor import utils -from keras.layers.convolutional.base_conv import Conv +from tf_keras import activations +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.dtensor import utils +from tf_keras.layers.convolutional.base_conv import Conv # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/convolutional/conv1d_transpose.py b/tf_keras/layers/convolutional/conv1d_transpose.py similarity index 97% rename from keras/layers/convolutional/conv1d_transpose.py rename to tf_keras/layers/convolutional/conv1d_transpose.py index e74cff033..85d839aa4 100644 --- a/keras/layers/convolutional/conv1d_transpose.py +++ b/tf_keras/layers/convolutional/conv1d_transpose.py @@ -17,14 +17,14 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.dtensor import utils -from keras.engine.input_spec import InputSpec -from keras.layers.convolutional.conv1d import Conv1D -from keras.utils import conv_utils +from tf_keras import activations +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.dtensor import utils +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.convolutional.conv1d import Conv1D +from tf_keras.utils import conv_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/convolutional/conv2d.py b/tf_keras/layers/convolutional/conv2d.py similarity index 96% rename from keras/layers/convolutional/conv2d.py rename to tf_keras/layers/convolutional/conv2d.py index 6a6c3aae0..deea6a1fb 100644 --- a/keras/layers/convolutional/conv2d.py +++ b/tf_keras/layers/convolutional/conv2d.py @@ -15,12 +15,12 @@ """Keras 2D convolution layer.""" -from keras import activations -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.dtensor import utils -from keras.layers.convolutional.base_conv import Conv +from tf_keras import activations +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.dtensor import utils +from tf_keras.layers.convolutional.base_conv import Conv # isort: off from tensorflow.python.util.tf_export import keras_export @@ -102,7 +102,7 @@ class Conv2D(Conv): `channels_last` corresponds to inputs with shape `(batch_size, height, width, channels)` while `channels_first` corresponds to inputs with shape `(batch_size, channels, height, width)`. If left unspecified, it - uses the `image_data_format` value found in your Keras config file at + uses the `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Note that the `channels_first` format is currently not supported by TensorFlow on CPU. Defaults to 'channels_last'. diff --git a/keras/layers/convolutional/conv2d_transpose.py b/tf_keras/layers/convolutional/conv2d_transpose.py similarity index 97% rename from keras/layers/convolutional/conv2d_transpose.py rename to tf_keras/layers/convolutional/conv2d_transpose.py index 772b761e9..f508ffbce 100644 --- a/keras/layers/convolutional/conv2d_transpose.py +++ b/tf_keras/layers/convolutional/conv2d_transpose.py @@ -17,15 +17,15 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.dtensor import utils -from keras.engine.input_spec import InputSpec -from keras.layers.convolutional.conv2d import Conv2D -from keras.utils import conv_utils +from tf_keras import activations +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.dtensor import utils +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.convolutional.conv2d import Conv2D +from tf_keras.utils import conv_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/convolutional/conv3d.py b/tf_keras/layers/convolutional/conv3d.py similarity index 96% rename from keras/layers/convolutional/conv3d.py rename to tf_keras/layers/convolutional/conv3d.py index bfcfcf501..c186881f9 100644 --- a/keras/layers/convolutional/conv3d.py +++ b/tf_keras/layers/convolutional/conv3d.py @@ -15,12 +15,12 @@ """Keras 3D convolution layer.""" -from keras import activations -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.dtensor import utils -from keras.layers.convolutional.base_conv import Conv +from tf_keras import activations +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.dtensor import utils +from tf_keras.layers.convolutional.base_conv import Conv # isort: off from tensorflow.python.util.tf_export import keras_export @@ -84,7 +84,7 @@ class Conv3D(Conv): (spatial_dim1, spatial_dim2, spatial_dim3, channels)` while `channels_first` corresponds to inputs with shape `batch_shape + (channels, spatial_dim1, spatial_dim2, spatial_dim3)`. When unspecified, - uses `image_data_format` value found in your Keras config file at + uses `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Note that the `channels_first` format is currently not supported by TensorFlow on CPU. Defaults to 'channels_last'. diff --git a/keras/layers/convolutional/conv3d_transpose.py b/tf_keras/layers/convolutional/conv3d_transpose.py similarity index 97% rename from keras/layers/convolutional/conv3d_transpose.py rename to tf_keras/layers/convolutional/conv3d_transpose.py index dcb9b54a6..c166e4900 100644 --- a/keras/layers/convolutional/conv3d_transpose.py +++ b/tf_keras/layers/convolutional/conv3d_transpose.py @@ -17,14 +17,14 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.dtensor import utils -from keras.engine.input_spec import InputSpec -from keras.layers.convolutional.conv3d import Conv3D -from keras.utils import conv_utils +from tf_keras import activations +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.dtensor import utils +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.convolutional.conv3d import Conv3D +from tf_keras.utils import conv_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/convolutional/conv_test.py b/tf_keras/layers/convolutional/conv_test.py similarity index 99% rename from keras/layers/convolutional/conv_test.py rename to tf_keras/layers/convolutional/conv_test.py index 859a45cfb..145b8a534 100644 --- a/keras/layers/convolutional/conv_test.py +++ b/tf_keras/layers/convolutional/conv_test.py @@ -19,9 +19,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/layers/convolutional/conv_transpose_test.py b/tf_keras/layers/convolutional/conv_transpose_test.py similarity index 98% rename from keras/layers/convolutional/conv_transpose_test.py rename to tf_keras/layers/convolutional/conv_transpose_test.py index 674777337..1d9227f28 100644 --- a/keras/layers/convolutional/conv_transpose_test.py +++ b/tf_keras/layers/convolutional/conv_transpose_test.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/convolutional/depthwise_conv1d.py b/tf_keras/layers/convolutional/depthwise_conv1d.py similarity index 97% rename from keras/layers/convolutional/depthwise_conv1d.py rename to tf_keras/layers/convolutional/depthwise_conv1d.py index b1cca7a37..3bee0740c 100644 --- a/keras/layers/convolutional/depthwise_conv1d.py +++ b/tf_keras/layers/convolutional/depthwise_conv1d.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras.layers.convolutional.base_depthwise_conv import DepthwiseConv -from keras.utils import conv_utils -from keras.utils import tf_utils +from tf_keras.layers.convolutional.base_depthwise_conv import DepthwiseConv +from tf_keras.utils import conv_utils +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -68,7 +68,7 @@ class DepthwiseConv1D(DepthwiseConv): `channels_last` corresponds to inputs with shape `(batch_size, height, width, channels)` while `channels_first` corresponds to inputs with shape `(batch_size, channels, height, width)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. dilation_rate: A single integer, specifying the dilation rate to use for diff --git a/keras/layers/convolutional/depthwise_conv2d.py b/tf_keras/layers/convolutional/depthwise_conv2d.py similarity index 97% rename from keras/layers/convolutional/depthwise_conv2d.py rename to tf_keras/layers/convolutional/depthwise_conv2d.py index 24edea729..9d1b95c69 100644 --- a/keras/layers/convolutional/depthwise_conv2d.py +++ b/tf_keras/layers/convolutional/depthwise_conv2d.py @@ -15,10 +15,10 @@ """Keras depthwise 2D convolution.""" -from keras import backend -from keras.layers.convolutional.base_depthwise_conv import DepthwiseConv -from keras.utils import conv_utils -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.layers.convolutional.base_depthwise_conv import DepthwiseConv +from tf_keras.utils import conv_utils +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -69,7 +69,7 @@ class DepthwiseConv2D(DepthwiseConv): `channels_last` corresponds to inputs with shape `(batch_size, height, width, channels)` while `channels_first` corresponds to inputs with shape `(batch_size, channels, height, width)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. dilation_rate: An integer or tuple/list of 2 integers, specifying the diff --git a/keras/layers/convolutional/depthwise_conv_test.py b/tf_keras/layers/convolutional/depthwise_conv_test.py similarity index 97% rename from keras/layers/convolutional/depthwise_conv_test.py rename to tf_keras/layers/convolutional/depthwise_conv_test.py index dd8e58584..4ee9f3635 100644 --- a/keras/layers/convolutional/depthwise_conv_test.py +++ b/tf_keras/layers/convolutional/depthwise_conv_test.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/convolutional/separable_conv1d.py b/tf_keras/layers/convolutional/separable_conv1d.py similarity index 97% rename from keras/layers/convolutional/separable_conv1d.py rename to tf_keras/layers/convolutional/separable_conv1d.py index 46ade298d..d9515c74c 100644 --- a/keras/layers/convolutional/separable_conv1d.py +++ b/tf_keras/layers/convolutional/separable_conv1d.py @@ -17,12 +17,12 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.layers.convolutional.base_separable_conv import SeparableConv -from keras.utils import conv_utils +from tf_keras import activations +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.layers.convolutional.base_separable_conv import SeparableConv +from tf_keras.utils import conv_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/convolutional/separable_conv2d.py b/tf_keras/layers/convolutional/separable_conv2d.py similarity index 97% rename from keras/layers/convolutional/separable_conv2d.py rename to tf_keras/layers/convolutional/separable_conv2d.py index 18e9ad495..a3796ffb5 100644 --- a/keras/layers/convolutional/separable_conv2d.py +++ b/tf_keras/layers/convolutional/separable_conv2d.py @@ -17,12 +17,12 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.layers.convolutional.base_separable_conv import SeparableConv -from keras.utils import conv_utils +from tf_keras import activations +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.layers.convolutional.base_separable_conv import SeparableConv +from tf_keras.utils import conv_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/convolutional/separable_conv_test.py b/tf_keras/layers/convolutional/separable_conv_test.py similarity index 98% rename from keras/layers/convolutional/separable_conv_test.py rename to tf_keras/layers/convolutional/separable_conv_test.py index b4abfc101..2b7037961 100644 --- a/keras/layers/convolutional/separable_conv_test.py +++ b/tf_keras/layers/convolutional/separable_conv_test.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/core/BUILD b/tf_keras/layers/core/BUILD similarity index 56% rename from keras/layers/core/BUILD rename to tf_keras/layers/core/BUILD index 2148cac8f..fd2e53328 100644 --- a/keras/layers/core/BUILD +++ b/tf_keras/layers/core/BUILD @@ -1,20 +1,19 @@ # Placeholder: load unaliased py_library # Description: -# Contains the Keras core layers. -load("@org_keras//keras:keras.bzl", "cuda_py_test") +# Contains the TF-Keras core layers. +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/py/tensorflow_gnn:__subpackages__", "//third_party/tensorflow/python/distribute:__pkg__", "//third_party/tensorflow/python/feature_column:__pkg__", - "//third_party/tensorflow/python/keras:__subpackages__", "//third_party/tensorflow/python/trackable:__pkg__", "//third_party/tensorflow/tools/pip_package:__pkg__", "//third_party/tensorflow_models/official/projects/residual_mobilenet/modeling/backbones:__pkg__", @@ -37,15 +36,15 @@ py_library( ":lambda", ":masking", ":tf_op_layer", - "//keras/layers/regularization:activity_regularization", - "//keras/layers/regularization:dropout", - "//keras/layers/regularization:spatial_dropout1d", - "//keras/layers/regularization:spatial_dropout2d", - "//keras/layers/regularization:spatial_dropout3d", - "//keras/layers/reshaping:flatten", - "//keras/layers/reshaping:permute", - "//keras/layers/reshaping:repeat_vector", - "//keras/layers/reshaping:reshape", + "//tf_keras/layers/regularization:activity_regularization", + "//tf_keras/layers/regularization:dropout", + "//tf_keras/layers/regularization:spatial_dropout1d", + "//tf_keras/layers/regularization:spatial_dropout2d", + "//tf_keras/layers/regularization:spatial_dropout3d", + "//tf_keras/layers/reshaping:flatten", + "//tf_keras/layers/reshaping:permute", + "//tf_keras/layers/reshaping:repeat_vector", + "//tf_keras/layers/reshaping:reshape", ], ) @@ -54,7 +53,7 @@ py_library( srcs = ["activation.py"], deps = [ "//:expect_tensorflow_installed", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -63,8 +62,8 @@ py_library( srcs = ["dense.py"], deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/dtensor:utils", + "//tf_keras:backend", + "//tf_keras/dtensor:utils", ], ) @@ -74,11 +73,11 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:base_layer", - "//keras/initializers", + "//tf_keras:activations", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:base_layer", + "//tf_keras/initializers", ], ) @@ -88,14 +87,14 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras:constraints", - "//keras:regularizers", - "//keras/dtensor:utils", - "//keras/engine:base_layer", - "//keras/engine:base_layer_utils", - "//keras/initializers", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/dtensor:utils", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:base_layer_utils", + "//tf_keras/initializers", + "//tf_keras/utils:tf_utils", ], ) @@ -104,7 +103,7 @@ py_library( srcs = ["lambda_layer.py"], deps = [ "//:expect_tensorflow_installed", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -113,7 +112,7 @@ py_library( srcs = ["masking.py"], deps = [ "//:expect_tensorflow_installed", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -123,12 +122,12 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:base_layer", - "//keras/initializers", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:base_layer", + "//tf_keras/initializers", + "//tf_keras/utils:tf_utils", ], ) @@ -138,7 +137,7 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/engine:base_layer", + "//tf_keras/engine:base_layer", ], ) @@ -149,11 +148,11 @@ tf_py_test( python_version = "PY3", shard_count = 3, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -163,12 +162,12 @@ tf_py_test( python_version = "PY3", deps = [ ":einsum_dense", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -180,9 +179,9 @@ cuda_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/mixed_precision:policy", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/mixed_precision:policy", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) diff --git a/tf_keras/layers/core/__init__.py b/tf_keras/layers/core/__init__.py new file mode 100644 index 000000000..60b21d5c5 --- /dev/null +++ b/tf_keras/layers/core/__init__.py @@ -0,0 +1,47 @@ +# 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. +# ============================================================================== +"""Core TF-Keras layers.""" + +from tf_keras.layers.core.activation import Activation +from tf_keras.layers.core.dense import Dense +from tf_keras.layers.core.einsum_dense import EinsumDense +from tf_keras.layers.core.embedding import Embedding +from tf_keras.layers.core.identity import Identity +from tf_keras.layers.core.lambda_layer import Lambda +from tf_keras.layers.core.masking import Masking + +# Required by third_party/py/tensorflow_gnn/tf_keras/keras_tensors.py +from tf_keras.layers.core.tf_op_layer import ClassMethod +from tf_keras.layers.core.tf_op_layer import InstanceMethod +from tf_keras.layers.core.tf_op_layer import InstanceProperty +from tf_keras.layers.core.tf_op_layer import SlicingOpLambda +from tf_keras.layers.core.tf_op_layer import TFOpLambda +from tf_keras.layers.core.tf_op_layer import _delegate_method +from tf_keras.layers.core.tf_op_layer import _delegate_property + +# Regularization layers imported for backwards namespace compatibility +from tf_keras.layers.regularization.activity_regularization import ( + ActivityRegularization, +) +from tf_keras.layers.regularization.dropout import Dropout +from tf_keras.layers.regularization.spatial_dropout1d import SpatialDropout1D +from tf_keras.layers.regularization.spatial_dropout2d import SpatialDropout2D +from tf_keras.layers.regularization.spatial_dropout3d import SpatialDropout3D + +# Reshaping layers imported for backwards namespace compatibility +from tf_keras.layers.reshaping.flatten import Flatten +from tf_keras.layers.reshaping.permute import Permute +from tf_keras.layers.reshaping.repeat_vector import RepeatVector +from tf_keras.layers.reshaping.reshape import Reshape diff --git a/keras/layers/core/activation.py b/tf_keras/layers/core/activation.py similarity index 96% rename from keras/layers/core/activation.py rename to tf_keras/layers/core/activation.py index 9cfaade39..718efe10a 100644 --- a/keras/layers/core/activation.py +++ b/tf_keras/layers/core/activation.py @@ -15,8 +15,8 @@ """Contains the Activation layer.""" -from keras import activations -from keras.engine.base_layer import Layer +from tf_keras import activations +from tf_keras.engine.base_layer import Layer # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/core/core_test.py b/tf_keras/layers/core/core_test.py similarity index 98% rename from keras/layers/core/core_test.py rename to tf_keras/layers/core/core_test.py index 345eb9e33..6371e8c4e 100644 --- a/keras/layers/core/core_test.py +++ b/tf_keras/layers/core/core_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras core layers.""" +"""Tests for TF-Keras core layers.""" import os import textwrap @@ -20,13 +20,13 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras import initializers -from keras.layers import core -from keras.mixed_precision import policy -from keras.saving.serialization_lib import SafeModeScope -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras import initializers +from tf_keras.layers import core +from tf_keras.mixed_precision import policy +from tf_keras.saving.serialization_lib import SafeModeScope +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes @@ -652,7 +652,7 @@ def test_dense_layer_ragged_tensor(self): ) def test_dense_layer_ragged_tensor_savedmodel(self): - # Check that we don't get a deadlock when saving a Keras model with + # Check that we don't get a deadlock when saving a TF-Keras model with # a dense layer that processes RaggedTensors. (This happened because # Dense.call() had a recursive call, which is not currently supported # by the @tf.function decorator.) diff --git a/keras/layers/core/dense.py b/tf_keras/layers/core/dense.py similarity index 97% rename from keras/layers/core/dense.py rename to tf_keras/layers/core/dense.py index 49c03bfa3..e3383cdfd 100644 --- a/keras/layers/core/dense.py +++ b/tf_keras/layers/core/dense.py @@ -17,14 +17,14 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.dtensor import utils -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec +from tf_keras import activations +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.dtensor import utils +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/core/einsum_dense.py b/tf_keras/layers/core/einsum_dense.py similarity index 98% rename from keras/layers/core/einsum_dense.py rename to tf_keras/layers/core/einsum_dense.py index e1d3ca334..2d377d57c 100644 --- a/keras/layers/core/einsum_dense.py +++ b/tf_keras/layers/core/einsum_dense.py @@ -19,11 +19,11 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine.base_layer import Layer +from tf_keras import activations +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine.base_layer import Layer # isort: off from tensorflow.python.util.tf_export import keras_export @@ -66,7 +66,7 @@ class EinsumDense(Layer): **Biased dense layer with einsums** - This example shows how to instantiate a standard Keras dense layer using + This example shows how to instantiate a standard TF-Keras dense layer using einsum operations. This example is equivalent to `tf.keras.layers.Dense(64, use_bias=True)`. diff --git a/keras/layers/core/einsum_dense_test.py b/tf_keras/layers/core/einsum_dense_test.py similarity index 97% rename from keras/layers/core/einsum_dense_test.py rename to tf_keras/layers/core/einsum_dense_test.py index f2cb24457..1f5841a89 100644 --- a/keras/layers/core/einsum_dense_test.py +++ b/tf_keras/layers/core/einsum_dense_test.py @@ -19,10 +19,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.core import einsum_dense -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.layers.core import einsum_dense +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes @@ -278,7 +278,7 @@ def test_layer_creation( expected_bias_shape, expected_output_shape, ): - # Keras elides the 0-dimension of the input shape when constructing + # TF-Keras elides the 0-dimension of the input shape when constructing # inputs. non_batch_input_shape = list(input_shape)[1:] diff --git a/keras/layers/core/embedding.py b/tf_keras/layers/core/embedding.py similarity index 93% rename from keras/layers/core/embedding.py rename to tf_keras/layers/core/embedding.py index cd75001b1..8cef7d332 100644 --- a/keras/layers/core/embedding.py +++ b/tf_keras/layers/core/embedding.py @@ -17,14 +17,15 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.dtensor import utils -from keras.engine import base_layer_utils -from keras.engine.base_layer import Layer -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.dtensor import utils +from tf_keras.engine import base_layer_utils +from tf_keras.engine.base_layer import Layer +from tf_keras.saving.serialization_lib import deserialize_keras_object +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -304,3 +305,14 @@ def get_config(self): } base_config = super().get_config() return dict(list(base_config.items()) + list(config.items())) + + @classmethod + def from_config(cls, config): + # Handles deserialization of tensors passed as dimension arguments + if isinstance(config["input_dim"], dict): + config["input_dim"] = deserialize_keras_object(config["input_dim"]) + if isinstance(config["output_dim"], dict): + config["output_dim"] = deserialize_keras_object( + config["output_dim"] + ) + return cls(**config) diff --git a/keras/layers/core/embedding_test.py b/tf_keras/layers/core/embedding_test.py similarity index 93% rename from keras/layers/core/embedding_test.py rename to tf_keras/layers/core/embedding_test.py index 0994f208f..4ae1e6c75 100644 --- a/keras/layers/core/embedding_test.py +++ b/tf_keras/layers/core/embedding_test.py @@ -14,13 +14,15 @@ # ============================================================================== """Tests for embedding layer.""" +import os + import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.mixed_precision import policy -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.mixed_precision import policy +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class EmbeddingTest(test_combinations.TestCase): @@ -253,6 +255,17 @@ def test_use_one_hot(self): self.assertNotIn("use_one_hot_matmul", layer.get_config()) + @test_combinations.run_all_keras_modes + def test_tensor_dim_serialization(self): + embedding_size = tf.constant(16000) + layer = keras.layers.Embedding(input_dim=embedding_size, output_dim=128) + model = keras.models.Sequential([layer]) + + temp_filepath = os.path.join(self.get_temp_dir(), "model.keras") + model.save(temp_filepath) + loaded = keras.models.load_model(temp_filepath) + self.assertEqual(loaded.layers[0].input_dim, tf.constant(16000)) + if __name__ == "__main__": tf.test.main() diff --git a/keras/layers/core/identity.py b/tf_keras/layers/core/identity.py similarity index 96% rename from keras/layers/core/identity.py rename to tf_keras/layers/core/identity.py index 2b5c0cff7..1596d1332 100644 --- a/keras/layers/core/identity.py +++ b/tf_keras/layers/core/identity.py @@ -16,7 +16,7 @@ import tensorflow.compat.v2 as tf -from keras.engine.base_layer import Layer +from tf_keras.engine.base_layer import Layer # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/core/lambda_layer.py b/tf_keras/layers/core/lambda_layer.py similarity index 98% rename from keras/layers/core/lambda_layer.py rename to tf_keras/layers/core/lambda_layer.py index 1a8c2142d..e6c0399af 100644 --- a/keras/layers/core/lambda_layer.py +++ b/tf_keras/layers/core/lambda_layer.py @@ -22,11 +22,11 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.engine.base_layer import Layer -from keras.saving import serialization_lib -from keras.utils import generic_utils -from keras.utils import tf_inspect -from keras.utils import tf_utils +from tf_keras.engine.base_layer import Layer +from tf_keras.saving import serialization_lib +from tf_keras.utils import generic_utils +from tf_keras.utils import tf_inspect +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.platform import tf_logging @@ -42,7 +42,7 @@ class Lambda(Layer): and Functional API models. `Lambda` layers are best suited for simple operations or quick experimentation. For more advanced use cases, follow [this guide]( - https://www.tensorflow.org/guide/keras/custom_layers_and_models) + https://www.tensorflow.org/guide/tf_keras/custom_layers_and_models) for subclassing `tf.keras.layers.Layer`. WARNING: `tf.keras.layers.Lambda` layers have (de)serialization limitations! diff --git a/keras/layers/core/masking.py b/tf_keras/layers/core/masking.py similarity index 96% rename from keras/layers/core/masking.py rename to tf_keras/layers/core/masking.py index c710bf347..bde9dfdd1 100644 --- a/keras/layers/core/masking.py +++ b/tf_keras/layers/core/masking.py @@ -17,7 +17,7 @@ import tensorflow.compat.v2 as tf -from keras.engine.base_layer import Layer +from tf_keras.engine.base_layer import Layer # isort: off from tensorflow.python.util.tf_export import keras_export @@ -60,7 +60,7 @@ class Masking(Layer): ``` See [the masking and padding guide]( - https://www.tensorflow.org/guide/keras/masking_and_padding) + https://www.tensorflow.org/guide/tf_keras/masking_and_padding) for more details. """ diff --git a/keras/layers/core/tf_op_layer.py b/tf_keras/layers/core/tf_op_layer.py similarity index 97% rename from keras/layers/core/tf_op_layer.py rename to tf_keras/layers/core/tf_op_layer.py index 41f3ae93b..e9f68abed 100644 --- a/keras/layers/core/tf_op_layer.py +++ b/tf_keras/layers/core/tf_op_layer.py @@ -15,9 +15,9 @@ """Contains the TFOpLambda layer.""" import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import keras_tensor -from keras.engine.base_layer import Layer +from tf_keras import backend +from tf_keras.engine import keras_tensor +from tf_keras.engine.base_layer import Layer # isort: off from tensorflow.python.platform import tf_logging @@ -76,10 +76,10 @@ def call(self, args, kwargs): def get_config(self): if not self.cls_symbol: raise ValueError( - "This Keras class method conversion tried to convert " + "This TF-Keras class method conversion tried to convert " f"a method belonging to class {self.cls_symbol}, a class " "that is not publicly exposed in the TensorFlow API. " - "To ensure cross-version compatibility of Keras models " + "To ensure cross-version compatibility of TF-Keras models " "that use op layers, only op layers produced from " "public TensorFlow API symbols can be serialized." ) @@ -127,7 +127,7 @@ def handle(self, op, args, kwargs): class InstanceProperty(Layer): """Wraps an instance property access (e.g. - `x.foo`) in a Keras Layer. + `x.foo`) in a TF-Keras Layer. This layer takes an attribute name `attr_name` in the constructor and, when called on input tensor `obj` returns `obj.attr_name`. @@ -176,7 +176,7 @@ def from_config(cls, config, custom_objects=None): class InstanceMethod(InstanceProperty): - """Wraps an instance method access (e.g. `x.foo(arg)` in a Keras Layer. + """Wraps an instance method access (e.g. `x.foo(arg)` in a TF-Keras Layer. This layer takes an attribute name `attr_name` in the constructor and, when called on input tensor `obj` with additional arguments `args` and @@ -326,12 +326,12 @@ def _warn(self, msg): def get_config(self): if not self.symbol: raise ValueError( - f"This Keras op layer was generated from {self.function}, a " + f"This TF-Keras op layer was generated from {self.function}, a " "method that is not publicly exposed in the TensorFlow API. " "This may have happened if the method was explicitly " "decorated to add dispatching support, and it was used " "during Functional model construction. " - "To ensure cross-version compatibility of Keras models " + "To ensure cross-version compatibility of TF-Keras models " "that use op layers, only op layers produced from " "public TensorFlow API symbols can be serialized." ) @@ -368,7 +368,7 @@ def _delegate_property(keras_tensor_cls, property_name): property_name: The name of the property to expose and delegate to the represented (Composite)Tensor. """ - # We use a lambda because we can't create a Keras layer at import time + # We use a lambda because we can't create a TF-Keras layer at import time # due to dynamic layer class versioning. property_access = property( lambda self: InstanceProperty(property_name)(self) diff --git a/keras/layers/kernelized.py b/tf_keras/layers/kernelized.py similarity index 98% rename from keras/layers/kernelized.py rename to tf_keras/layers/kernelized.py index f8114bbb7..2924644b3 100644 --- a/keras/layers/kernelized.py +++ b/tf_keras/layers/kernelized.py @@ -18,9 +18,9 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import initializers -from keras.engine import base_layer -from keras.engine import input_spec +from tf_keras import initializers +from tf_keras.engine import base_layer +from tf_keras.engine import input_spec # isort: off from tensorflow.python.util.tf_export import keras_export @@ -118,7 +118,7 @@ class RandomFourierFeatures(base_layer.Layer): the number of random features used to approximate the kernel. kernel_initializer: Determines the distribution of the parameters of the random features map (and therefore the kernel approximated by the - layer). It can be either a string identifier or a Keras `Initializer` + layer). It can be either a string identifier or a TF-Keras `Initializer` instance. Currently only 'gaussian' and 'laplacian' are supported string identifiers (case insensitive). Note that the kernel matrix is not trainable. diff --git a/keras/layers/kernelized_test.py b/tf_keras/layers/kernelized_test.py similarity index 97% rename from keras/layers/kernelized_test.py rename to tf_keras/layers/kernelized_test.py index 33835ccd5..26535c020 100644 --- a/keras/layers/kernelized_test.py +++ b/tf_keras/layers/kernelized_test.py @@ -23,16 +23,16 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import backend as keras_backend -from keras import initializers -from keras.engine import base_layer_utils -from keras.engine import input_layer -from keras.engine import training -from keras.layers import kernelized as kernel_layers -from keras.saving.legacy import save -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import kernelized_utils +from tf_keras import backend as keras_backend +from tf_keras import initializers +from tf_keras.engine import base_layer_utils +from tf_keras.engine import input_layer +from tf_keras.engine import training +from tf_keras.layers import kernelized as kernel_layers +from tf_keras.saving.legacy import save +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import kernelized_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/layers/layers_test.py b/tf_keras/layers/layers_test.py similarity index 97% rename from keras/layers/layers_test.py rename to tf_keras/layers/layers_test.py index 1072f5948..9440fef20 100644 --- a/keras/layers/layers_test.py +++ b/tf_keras/layers/layers_test.py @@ -17,7 +17,7 @@ import tensorflow.compat.v2 as tf -from keras import layers +from tf_keras import layers class LayersTest(tf.test.TestCase): diff --git a/keras/layers/locally_connected/BUILD b/tf_keras/layers/locally_connected/BUILD similarity index 50% rename from keras/layers/locally_connected/BUILD rename to tf_keras/layers/locally_connected/BUILD index e6ee324c6..eb12877e2 100644 --- a/keras/layers/locally_connected/BUILD +++ b/tf_keras/layers/locally_connected/BUILD @@ -1,13 +1,13 @@ # Description: -# Contains the Keras locally-connected layers. +# Contains the TF-Keras locally-connected layers. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", ], licenses = ["notice"], ) @@ -31,8 +31,8 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/utils:engine_utils", + "//tf_keras:backend", + "//tf_keras/utils:engine_utils", ], ) @@ -42,15 +42,15 @@ py_library( srcs_version = "PY3", deps = [ ":locally_connected_utils", - "//keras:activations", - "//keras:backend", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/initializers", - "//keras/utils:engine_utils", - "//keras/utils:tf_utils", + "//tf_keras:activations", + "//tf_keras:backend", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + "//tf_keras/utils:engine_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -60,15 +60,15 @@ py_library( srcs_version = "PY3", deps = [ ":locally_connected_utils", - "//keras:activations", - "//keras:backend", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/initializers", - "//keras/utils:engine_utils", - "//keras/utils:tf_utils", + "//tf_keras:activations", + "//tf_keras:backend", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + "//tf_keras/utils:engine_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -80,12 +80,12 @@ tf_py_test( shard_count = 4, tags = ["no_windows"], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/optimizers/legacy:optimizers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/optimizers/legacy:optimizers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) diff --git a/keras/layers/locally_connected/__init__.py b/tf_keras/layers/locally_connected/__init__.py similarity index 85% rename from keras/layers/locally_connected/__init__.py rename to tf_keras/layers/locally_connected/__init__.py index 9dbd20b35..ed27b9079 100644 --- a/keras/layers/locally_connected/__init__.py +++ b/tf_keras/layers/locally_connected/__init__.py @@ -14,9 +14,9 @@ # ============================================================================== """Keras locally-connected layers.""" -from keras.layers.locally_connected.locally_connected1d import ( +from tf_keras.layers.locally_connected.locally_connected1d import ( LocallyConnected1D, ) -from keras.layers.locally_connected.locally_connected2d import ( +from tf_keras.layers.locally_connected.locally_connected2d import ( LocallyConnected2D, ) diff --git a/keras/layers/locally_connected/locally_connected1d.py b/tf_keras/layers/locally_connected/locally_connected1d.py similarity index 96% rename from keras/layers/locally_connected/locally_connected1d.py rename to tf_keras/layers/locally_connected/locally_connected1d.py index 32fe80fee..ad5d202b1 100644 --- a/keras/layers/locally_connected/locally_connected1d.py +++ b/tf_keras/layers/locally_connected/locally_connected1d.py @@ -15,16 +15,16 @@ """Locally-connected layer for 1D input.""" -from keras import activations -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.layers.locally_connected import locally_connected_utils -from keras.utils import conv_utils -from keras.utils import tf_utils +from tf_keras import activations +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.locally_connected import locally_connected_utils +from tf_keras.utils import conv_utils +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -68,7 +68,7 @@ class LocallyConnected1D(Layer): `channels_last` corresponds to inputs with shape `(batch, length, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, length)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. activation: Activation function to use. If you don't specify anything, diff --git a/keras/layers/locally_connected/locally_connected2d.py b/tf_keras/layers/locally_connected/locally_connected2d.py similarity index 97% rename from keras/layers/locally_connected/locally_connected2d.py rename to tf_keras/layers/locally_connected/locally_connected2d.py index fce8c32e2..8d3d0afc5 100644 --- a/keras/layers/locally_connected/locally_connected2d.py +++ b/tf_keras/layers/locally_connected/locally_connected2d.py @@ -15,16 +15,16 @@ """Locally-connected layer for 2D input.""" -from keras import activations -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.layers.locally_connected import locally_connected_utils -from keras.utils import conv_utils -from keras.utils import tf_utils +from tf_keras import activations +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.locally_connected import locally_connected_utils +from tf_keras.utils import conv_utils +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -75,7 +75,7 @@ class LocallyConnected2D(Layer): width, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, height, width)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. activation: Activation function to use. If you don't specify anything, diff --git a/keras/layers/locally_connected/locally_connected_test.py b/tf_keras/layers/locally_connected/locally_connected_test.py similarity index 99% rename from keras/layers/locally_connected/locally_connected_test.py rename to tf_keras/layers/locally_connected/locally_connected_test.py index bb85dee74..85c8abd3a 100644 --- a/keras/layers/locally_connected/locally_connected_test.py +++ b/tf_keras/layers/locally_connected/locally_connected_test.py @@ -21,11 +21,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.locally_connected import locally_connected_utils -from keras.optimizers.legacy import rmsprop -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.layers.locally_connected import locally_connected_utils +from tf_keras.optimizers.legacy import rmsprop +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/layers/locally_connected/locally_connected_utils.py b/tf_keras/layers/locally_connected/locally_connected_utils.py similarity index 99% rename from keras/layers/locally_connected/locally_connected_utils.py rename to tf_keras/layers/locally_connected/locally_connected_utils.py index 26695a506..d2b60eb46 100644 --- a/keras/layers/locally_connected/locally_connected_utils.py +++ b/tf_keras/layers/locally_connected/locally_connected_utils.py @@ -17,8 +17,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.utils import conv_utils +from tf_keras import backend +from tf_keras.utils import conv_utils def get_locallyconnected_mask( diff --git a/keras/layers/merging/BUILD b/tf_keras/layers/merging/BUILD similarity index 78% rename from keras/layers/merging/BUILD rename to tf_keras/layers/merging/BUILD index 7de776ca2..058c8753d 100644 --- a/keras/layers/merging/BUILD +++ b/tf_keras/layers/merging/BUILD @@ -1,13 +1,13 @@ # Description: -# Contains the Keras merging layers. +# Contains the TF-Keras merging layers. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/py/tensorflow_gnn:__subpackages__", "//third_party/tensorflow/python/distribute:__pkg__", "//third_party/tensorflow/python/feature_column:__pkg__", @@ -40,9 +40,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/utils:tf_utils", ], ) @@ -61,7 +61,7 @@ py_library( srcs_version = "PY3", deps = [ ":base_merge", - "//keras/utils:tf_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -110,8 +110,8 @@ py_library( deps = [ ":base_merge", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/utils:tf_utils", ], ) @@ -122,9 +122,9 @@ py_library( deps = [ ":base_merge", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer_utils", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -135,10 +135,10 @@ tf_py_test( python_version = "PY3", shard_count = 4, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/tf_keras/layers/merging/__init__.py b/tf_keras/layers/merging/__init__.py new file mode 100644 index 000000000..80584c91a --- /dev/null +++ b/tf_keras/layers/merging/__init__.py @@ -0,0 +1,35 @@ +# 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. +# ============================================================================== +"""Keras merging layers.""" + + +# Merging functions. +# Merging layers. +from tf_keras.layers.merging.add import Add +from tf_keras.layers.merging.add import add +from tf_keras.layers.merging.average import Average +from tf_keras.layers.merging.average import average +from tf_keras.layers.merging.concatenate import Concatenate +from tf_keras.layers.merging.concatenate import concatenate +from tf_keras.layers.merging.dot import Dot +from tf_keras.layers.merging.dot import dot +from tf_keras.layers.merging.maximum import Maximum +from tf_keras.layers.merging.maximum import maximum +from tf_keras.layers.merging.minimum import Minimum +from tf_keras.layers.merging.minimum import minimum +from tf_keras.layers.merging.multiply import Multiply +from tf_keras.layers.merging.multiply import multiply +from tf_keras.layers.merging.subtract import Subtract +from tf_keras.layers.merging.subtract import subtract diff --git a/keras/layers/merging/add.py b/tf_keras/layers/merging/add.py similarity index 98% rename from keras/layers/merging/add.py rename to tf_keras/layers/merging/add.py index 3df77c3ef..55ea927b7 100644 --- a/keras/layers/merging/add.py +++ b/tf_keras/layers/merging/add.py @@ -15,7 +15,7 @@ """Layer that adds several inputs.""" -from keras.layers.merging.base_merge import _Merge +from tf_keras.layers.merging.base_merge import _Merge # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/merging/average.py b/tf_keras/layers/merging/average.py similarity index 98% rename from keras/layers/merging/average.py rename to tf_keras/layers/merging/average.py index 87261c167..ba76343c6 100644 --- a/keras/layers/merging/average.py +++ b/tf_keras/layers/merging/average.py @@ -15,7 +15,7 @@ """Layer that averages several inputs.""" -from keras.layers.merging.base_merge import _Merge +from tf_keras.layers.merging.base_merge import _Merge # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/merging/base_merge.py b/tf_keras/layers/merging/base_merge.py similarity index 98% rename from keras/layers/merging/base_merge.py rename to tf_keras/layers/merging/base_merge.py index 058de0a0e..f452624f5 100644 --- a/keras/layers/merging/base_merge.py +++ b/tf_keras/layers/merging/base_merge.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.utils import tf_utils class _Merge(Layer): diff --git a/keras/layers/merging/concatenate.py b/tf_keras/layers/merging/concatenate.py similarity index 98% rename from keras/layers/merging/concatenate.py rename to tf_keras/layers/merging/concatenate.py index 3818e332d..6a7f4cfaf 100644 --- a/keras/layers/merging/concatenate.py +++ b/tf_keras/layers/merging/concatenate.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.layers.merging.base_merge import _Merge -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.layers.merging.base_merge import _Merge +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/merging/dot.py b/tf_keras/layers/merging/dot.py similarity index 98% rename from keras/layers/merging/dot.py rename to tf_keras/layers/merging/dot.py index 27fb48350..b6d95464e 100644 --- a/keras/layers/merging/dot.py +++ b/tf_keras/layers/merging/dot.py @@ -17,10 +17,10 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer_utils -from keras.layers.merging.base_merge import _Merge -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine import base_layer_utils +from tf_keras.layers.merging.base_merge import _Merge +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/merging/maximum.py b/tf_keras/layers/merging/maximum.py similarity index 98% rename from keras/layers/merging/maximum.py rename to tf_keras/layers/merging/maximum.py index de939d285..e5677be2d 100644 --- a/keras/layers/merging/maximum.py +++ b/tf_keras/layers/merging/maximum.py @@ -17,7 +17,7 @@ import tensorflow.compat.v2 as tf -from keras.layers.merging.base_merge import _Merge +from tf_keras.layers.merging.base_merge import _Merge # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/merging/merging_test.py b/tf_keras/layers/merging/merging_test.py similarity index 99% rename from keras/layers/merging/merging_test.py rename to tf_keras/layers/merging/merging_test.py index 1f3b59746..7597ba398 100644 --- a/keras/layers/merging/merging_test.py +++ b/tf_keras/layers/merging/merging_test.py @@ -18,11 +18,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import backend -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import tf_inspect +import tf_keras as keras +from tf_keras import backend +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import tf_inspect @test_combinations.run_all_keras_modes diff --git a/keras/layers/merging/minimum.py b/tf_keras/layers/merging/minimum.py similarity index 97% rename from keras/layers/merging/minimum.py rename to tf_keras/layers/merging/minimum.py index 4bfbd784e..53665eaed 100644 --- a/keras/layers/merging/minimum.py +++ b/tf_keras/layers/merging/minimum.py @@ -17,7 +17,7 @@ import tensorflow.compat.v2 as tf -from keras.layers.merging.base_merge import _Merge +from tf_keras.layers.merging.base_merge import _Merge # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/merging/multiply.py b/tf_keras/layers/merging/multiply.py similarity index 98% rename from keras/layers/merging/multiply.py rename to tf_keras/layers/merging/multiply.py index caae29c79..001c7fbff 100644 --- a/keras/layers/merging/multiply.py +++ b/tf_keras/layers/merging/multiply.py @@ -15,7 +15,7 @@ """Layer that multiplies (element-wise) several inputs.""" -from keras.layers.merging.base_merge import _Merge +from tf_keras.layers.merging.base_merge import _Merge # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/merging/subtract.py b/tf_keras/layers/merging/subtract.py similarity index 94% rename from keras/layers/merging/subtract.py rename to tf_keras/layers/merging/subtract.py index de55fa516..437683771 100644 --- a/keras/layers/merging/subtract.py +++ b/tf_keras/layers/merging/subtract.py @@ -15,8 +15,8 @@ """Layer that subtracts two inputs.""" -from keras.layers.merging.base_merge import _Merge -from keras.utils import tf_utils +from tf_keras.layers.merging.base_merge import _Merge +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -32,7 +32,7 @@ class Subtract(_Merge): Examples: ```python - import keras + import tf_keras as keras input1 = keras.layers.Input(shape=(16,)) x1 = keras.layers.Dense(8, activation='relu')(input1) @@ -78,7 +78,7 @@ def subtract(inputs, **kwargs): Examples: ```python - import keras + import tf_keras as keras input1 = keras.layers.Input(shape=(16,)) x1 = keras.layers.Dense(8, activation='relu')(input1) diff --git a/keras/layers/noise.py b/tf_keras/layers/noise.py similarity index 78% rename from keras/layers/noise.py rename to tf_keras/layers/noise.py index 7e479a435..fc168e52b 100644 --- a/keras/layers/noise.py +++ b/tf_keras/layers/noise.py @@ -15,12 +15,12 @@ """Layers that operate regularization via the addition of noise.""" -from keras.layers.regularization.alpha_dropout import AlphaDropout # noqa: F401 +from tf_keras.layers.regularization.alpha_dropout import AlphaDropout # noqa: F401 # Regularization layers imported for backwards namespace compatibility -from keras.layers.regularization.gaussian_dropout import ( # noqa: F401,E501 +from tf_keras.layers.regularization.gaussian_dropout import ( # noqa: F401,E501 GaussianDropout, ) -from keras.layers.regularization.gaussian_noise import ( # noqa: F401,E501 +from tf_keras.layers.regularization.gaussian_noise import ( # noqa: F401,E501 GaussianNoise, ) diff --git a/keras/layers/normalization/BUILD b/tf_keras/layers/normalization/BUILD similarity index 63% rename from keras/layers/normalization/BUILD rename to tf_keras/layers/normalization/BUILD index fffb79858..a465411d5 100644 --- a/keras/layers/normalization/BUILD +++ b/tf_keras/layers/normalization/BUILD @@ -1,18 +1,18 @@ # Description: -# Contains the Keras normalization layers (internal TensorFlow version). +# Contains the TF-Keras normalization layers (internal TensorFlow version). # Placeholder: load unaliased py_library # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], # TODO(scottzhu): Remove non-keras deps from TF. - default_visibility = ["//keras:friends"], + default_visibility = ["//tf_keras:friends"], licenses = ["notice"], ) @@ -38,14 +38,14 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras:constraints", - "//keras:regularizers", - "//keras/dtensor:utils", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/initializers", - "//keras/utils:control_flow_util", + "//tf_keras:backend", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/dtensor:utils", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + "//tf_keras/utils:control_flow_util", ], ) @@ -65,11 +65,11 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:constraints", - "//keras:regularizers", - "//keras/dtensor:utils", - "//keras/engine:base_layer", - "//keras/initializers", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/dtensor:utils", + "//tf_keras/engine:base_layer", + "//tf_keras/initializers", ], ) @@ -79,11 +79,11 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:constraints", - "//keras:regularizers", - "//keras/dtensor:utils", - "//keras/engine:base_layer", - "//keras/initializers", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/dtensor:utils", + "//tf_keras/engine:base_layer", + "//tf_keras/initializers", ], ) @@ -93,7 +93,7 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/engine:base_layer", + "//tf_keras/engine:base_layer", ], ) @@ -103,7 +103,7 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/engine:base_layer", + "//tf_keras/engine:base_layer", ], ) @@ -121,13 +121,13 @@ cuda_py_test( ], deps = [ ":group_normalization", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/layers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/layers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -142,13 +142,13 @@ cuda_py_test( ], deps = [ ":batch_normalization", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/layers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/layers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -161,9 +161,9 @@ tf_py_test( ":batch_normalization", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/dtensor:test_util", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/dtensor:test_util", + "//tf_keras/testing_infra:test_utils", "//third_party/tensorflow/python/distribute/experimental:mirrored_strategy", ], ) @@ -178,11 +178,11 @@ cuda_py_test( "notsan", ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -192,11 +192,11 @@ cuda_py_test( srcs = ["unit_normalization_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -206,10 +206,10 @@ cuda_py_test( srcs = ["spectral_normalization_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/keras/layers/normalization/__init__.py b/tf_keras/layers/normalization/__init__.py similarity index 100% rename from keras/layers/normalization/__init__.py rename to tf_keras/layers/normalization/__init__.py diff --git a/keras/layers/normalization/batch_normalization.py b/tf_keras/layers/normalization/batch_normalization.py similarity index 99% rename from keras/layers/normalization/batch_normalization.py rename to tf_keras/layers/normalization/batch_normalization.py index 759b0486a..9da9976a8 100644 --- a/keras/layers/normalization/batch_normalization.py +++ b/tf_keras/layers/normalization/batch_normalization.py @@ -18,15 +18,15 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.dtensor import utils -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import control_flow_util -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.dtensor import utils +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import control_flow_util +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.ops.control_flow_ops import ( @@ -709,7 +709,7 @@ def _compose_transforms(scale, offset, then_scale, then_offset): new_mean, new_variance = mean, variance if self._support_zero_size_input(): - # Keras assumes that batch dimension is the first dimension for + # TF-Keras assumes that batch dimension is the first dimension for # Batch Normalization. input_batch_size = tf.shape(inputs)[0] else: @@ -827,7 +827,7 @@ def get_config(self): "gamma_constraint": constraints.serialize(self.gamma_constraint), } # Only add TensorFlow-specific parameters if they are set, so as to - # preserve model compatibility with external Keras. + # preserve model compatibility with external TF-Keras. if self.renorm: config["renorm"] = True config["renorm_clipping"] = self.renorm_clipping @@ -920,7 +920,7 @@ def _fused_batch_norm(self, inputs, mask, training): # TODO(b/129279393): Support zero batch input in non # DistributionStrategy code as well. if self._support_zero_size_input(): - # Keras assumes that batch dimension is the first dimension for + # TF-Keras assumes that batch dimension is the first dimension for # Batch Normalization. input_batch_size = tf.shape(inputs)[0] else: diff --git a/keras/layers/normalization/batch_normalization_dtensor_test.py b/tf_keras/layers/normalization/batch_normalization_dtensor_test.py similarity index 96% rename from keras/layers/normalization/batch_normalization_dtensor_test.py rename to tf_keras/layers/normalization/batch_normalization_dtensor_test.py index fffc914a6..744f69cbe 100644 --- a/keras/layers/normalization/batch_normalization_dtensor_test.py +++ b/tf_keras/layers/normalization/batch_normalization_dtensor_test.py @@ -18,10 +18,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.dtensor import test_util -from keras.dtensor import utils -from keras.layers.normalization import batch_normalization -from keras.testing_infra import test_utils +from tf_keras.dtensor import test_util +from tf_keras.dtensor import utils +from tf_keras.layers.normalization import batch_normalization +from tf_keras.testing_infra import test_utils # isort: off # Import the MirroredStrategy that is backed by DTensor diff --git a/keras/layers/normalization/batch_normalization_test.py b/tf_keras/layers/normalization/batch_normalization_test.py similarity index 98% rename from keras/layers/normalization/batch_normalization_test.py rename to tf_keras/layers/normalization/batch_normalization_test.py index 80ea097ca..6b0ee139f 100644 --- a/keras/layers/normalization/batch_normalization_test.py +++ b/tf_keras/layers/normalization/batch_normalization_test.py @@ -18,11 +18,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.normalization import batch_normalization -from keras.layers.normalization import batch_normalization_v1 -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.layers.normalization import batch_normalization +from tf_keras.layers.normalization import batch_normalization_v1 +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class BatchNormalizationTest(test_combinations.TestCase): @@ -528,7 +528,7 @@ def _run_batchnorm_correctness_test( norm = layer(momentum=0.8, fused=fused, synchronized=synchronized) model.add(norm) if dtype == "float16": - # Keras models require float32 losses. + # TF-Keras models require float32 losses. model.add( keras.layers.Lambda(lambda x: keras.backend.cast(x, "float32")) ) diff --git a/keras/layers/normalization/batch_normalization_v1.py b/tf_keras/layers/normalization/batch_normalization_v1.py similarity index 94% rename from keras/layers/normalization/batch_normalization_v1.py rename to tf_keras/layers/normalization/batch_normalization_v1.py index 4d9feb311..d04ead162 100644 --- a/keras/layers/normalization/batch_normalization_v1.py +++ b/tf_keras/layers/normalization/batch_normalization_v1.py @@ -15,7 +15,7 @@ """Batch Normalization V1 layer.""" -from keras.layers.normalization import batch_normalization +from tf_keras.layers.normalization import batch_normalization # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/normalization/group_normalization.py b/tf_keras/layers/normalization/group_normalization.py similarity index 97% rename from keras/layers/normalization/group_normalization.py rename to tf_keras/layers/normalization/group_normalization.py index a0a39bc10..88e0fd215 100644 --- a/keras/layers/normalization/group_normalization.py +++ b/tf_keras/layers/normalization/group_normalization.py @@ -1,4 +1,4 @@ -# Copyright 2022 The Keras Authors. All Rights Reserved. +# Copyright 2022 The TF-Keras 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. @@ -16,13 +16,13 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.layers import InputSpec -from keras.layers import Layer -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.layers import InputSpec +from tf_keras.layers import Layer +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/normalization/group_normalization_test.py b/tf_keras/layers/normalization/group_normalization_test.py similarity index 97% rename from keras/layers/normalization/group_normalization_test.py rename to tf_keras/layers/normalization/group_normalization_test.py index d73455cd4..00ce1d7dc 100644 --- a/keras/layers/normalization/group_normalization_test.py +++ b/tf_keras/layers/normalization/group_normalization_test.py @@ -1,4 +1,4 @@ -# Copyright 2022 The Keras Authors. All Rights Reserved. +# Copyright 2022 The TF-Keras 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. @@ -15,11 +15,11 @@ import tensorflow.compat.v2 as tf -import keras -from keras.initializers import Constant -from keras.layers import GroupNormalization -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.initializers import Constant +from tf_keras.layers import GroupNormalization +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils def _build_group_normalization_model(norm): diff --git a/keras/layers/normalization/layer_normalization.py b/tf_keras/layers/normalization/layer_normalization.py similarity index 98% rename from keras/layers/normalization/layer_normalization.py rename to tf_keras/layers/normalization/layer_normalization.py index 42bcc08d1..e76919224 100644 --- a/keras/layers/normalization/layer_normalization.py +++ b/tf_keras/layers/normalization/layer_normalization.py @@ -16,12 +16,12 @@ import tensorflow.compat.v2 as tf -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.dtensor import utils -from keras.engine.base_layer import Layer -from keras.utils import tf_utils +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.dtensor import utils +from tf_keras.engine.base_layer import Layer +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/normalization/layer_normalization_test.py b/tf_keras/layers/normalization/layer_normalization_test.py similarity index 98% rename from keras/layers/normalization/layer_normalization_test.py rename to tf_keras/layers/normalization/layer_normalization_test.py index c3531d83f..9a8e79f2e 100644 --- a/keras/layers/normalization/layer_normalization_test.py +++ b/tf_keras/layers/normalization/layer_normalization_test.py @@ -17,10 +17,10 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.layers.normalization import layer_normalization -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.layers.normalization import layer_normalization +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils def _run_layernorm_correctness_test(layer, dtype="float32"): diff --git a/keras/layers/normalization/spectral_normalization.py b/tf_keras/layers/normalization/spectral_normalization.py similarity index 96% rename from keras/layers/normalization/spectral_normalization.py rename to tf_keras/layers/normalization/spectral_normalization.py index c958cd4a7..79a9df05a 100644 --- a/keras/layers/normalization/spectral_normalization.py +++ b/tf_keras/layers/normalization/spectral_normalization.py @@ -1,4 +1,4 @@ -# Copyright 2023 The Keras Authors. All Rights Reserved. +# Copyright 2023 The TF-Keras 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. @@ -15,8 +15,8 @@ import tensorflow.compat.v2 as tf -from keras.initializers import TruncatedNormal -from keras.layers.rnn import Wrapper +from tf_keras.initializers import TruncatedNormal +from tf_keras.layers.rnn import Wrapper # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/normalization/spectral_normalization_test.py b/tf_keras/layers/normalization/spectral_normalization_test.py similarity index 97% rename from keras/layers/normalization/spectral_normalization_test.py rename to tf_keras/layers/normalization/spectral_normalization_test.py index 555850291..096e48c4a 100644 --- a/keras/layers/normalization/spectral_normalization_test.py +++ b/tf_keras/layers/normalization/spectral_normalization_test.py @@ -1,4 +1,4 @@ -# Copyright 2023 The Keras Authors. All Rights Reserved. +# Copyright 2023 The TF-Keras 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. @@ -16,9 +16,9 @@ import tensorflow as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class SpectralNormalizationTest(test_combinations.TestCase): diff --git a/keras/layers/normalization/unit_normalization.py b/tf_keras/layers/normalization/unit_normalization.py similarity index 97% rename from keras/layers/normalization/unit_normalization.py rename to tf_keras/layers/normalization/unit_normalization.py index eb1746fdd..f3255bcb1 100644 --- a/keras/layers/normalization/unit_normalization.py +++ b/tf_keras/layers/normalization/unit_normalization.py @@ -17,8 +17,8 @@ import tensorflow.compat.v2 as tf -from keras.engine import base_layer -from keras.utils import tf_utils +from tf_keras.engine import base_layer +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/normalization/unit_normalization_test.py b/tf_keras/layers/normalization/unit_normalization_test.py similarity index 95% rename from keras/layers/normalization/unit_normalization_test.py rename to tf_keras/layers/normalization/unit_normalization_test.py index 386d5a043..16b9887d2 100644 --- a/keras/layers/normalization/unit_normalization_test.py +++ b/tf_keras/layers/normalization/unit_normalization_test.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils def squared_l2_norm(x): diff --git a/keras/layers/pooling/BUILD b/tf_keras/layers/pooling/BUILD similarity index 72% rename from keras/layers/pooling/BUILD rename to tf_keras/layers/pooling/BUILD index d622f7138..0d0eefef9 100644 --- a/keras/layers/pooling/BUILD +++ b/tf_keras/layers/pooling/BUILD @@ -1,13 +1,13 @@ # Description: -# Contains the Keras pooling layers. +# Contains the TF-Keras pooling layers. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/py/tensorflow_gnn:__subpackages__", "//third_party/tensorflow/python/distribute:__pkg__", "//third_party/tensorflow/python/feature_column:__pkg__", @@ -44,10 +44,10 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -57,10 +57,10 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -70,10 +70,10 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -83,9 +83,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -95,9 +95,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -107,9 +107,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -119,7 +119,7 @@ py_library( srcs_version = "PY3", deps = [ ":base_pooling1d", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -149,7 +149,7 @@ py_library( srcs_version = "PY3", deps = [ ":base_pooling1d", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -179,7 +179,7 @@ py_library( srcs_version = "PY3", deps = [ ":base_global_pooling1d", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -189,7 +189,7 @@ py_library( srcs_version = "PY3", deps = [ ":base_global_pooling2d", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -199,7 +199,7 @@ py_library( srcs_version = "PY3", deps = [ ":base_global_pooling3d", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -210,7 +210,7 @@ py_library( deps = [ ":base_global_pooling1d", "//:expect_tensorflow_installed", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -220,7 +220,7 @@ py_library( srcs_version = "PY3", deps = [ ":base_global_pooling2d", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -230,7 +230,7 @@ py_library( srcs_version = "PY3", deps = [ ":base_global_pooling3d", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -244,11 +244,11 @@ tf_py_test( "notsan", # TODO(b/183962355) ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -262,11 +262,11 @@ tf_py_test( "notsan", # TODO(b/183962355) ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -280,11 +280,11 @@ tf_py_test( "notsan", # TODO(b/183962355) ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -298,10 +298,10 @@ tf_py_test( "notsan", # TODO(b/183962355) ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) diff --git a/tf_keras/layers/pooling/__init__.py b/tf_keras/layers/pooling/__init__.py new file mode 100644 index 000000000..d6cec496a --- /dev/null +++ b/tf_keras/layers/pooling/__init__.py @@ -0,0 +1,43 @@ +# 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. +# ============================================================================== +"""Keras Pooling layers.""" + + +# Pooling layer aliases. +# Pooling layers. +from tf_keras.layers.pooling.average_pooling1d import AveragePooling1D +from tf_keras.layers.pooling.average_pooling1d import AvgPool1D +from tf_keras.layers.pooling.average_pooling2d import AveragePooling2D +from tf_keras.layers.pooling.average_pooling2d import AvgPool2D +from tf_keras.layers.pooling.average_pooling3d import AveragePooling3D +from tf_keras.layers.pooling.average_pooling3d import AvgPool3D +from tf_keras.layers.pooling.global_average_pooling1d import GlobalAveragePooling1D +from tf_keras.layers.pooling.global_average_pooling1d import GlobalAvgPool1D +from tf_keras.layers.pooling.global_average_pooling2d import GlobalAveragePooling2D +from tf_keras.layers.pooling.global_average_pooling2d import GlobalAvgPool2D +from tf_keras.layers.pooling.global_average_pooling3d import GlobalAveragePooling3D +from tf_keras.layers.pooling.global_average_pooling3d import GlobalAvgPool3D +from tf_keras.layers.pooling.global_max_pooling1d import GlobalMaxPool1D +from tf_keras.layers.pooling.global_max_pooling1d import GlobalMaxPooling1D +from tf_keras.layers.pooling.global_max_pooling2d import GlobalMaxPool2D +from tf_keras.layers.pooling.global_max_pooling2d import GlobalMaxPooling2D +from tf_keras.layers.pooling.global_max_pooling3d import GlobalMaxPool3D +from tf_keras.layers.pooling.global_max_pooling3d import GlobalMaxPooling3D +from tf_keras.layers.pooling.max_pooling1d import MaxPool1D +from tf_keras.layers.pooling.max_pooling1d import MaxPooling1D +from tf_keras.layers.pooling.max_pooling2d import MaxPool2D +from tf_keras.layers.pooling.max_pooling2d import MaxPooling2D +from tf_keras.layers.pooling.max_pooling3d import MaxPool3D +from tf_keras.layers.pooling.max_pooling3d import MaxPooling3D diff --git a/keras/layers/pooling/average_pooling1d.py b/tf_keras/layers/pooling/average_pooling1d.py similarity index 98% rename from keras/layers/pooling/average_pooling1d.py rename to tf_keras/layers/pooling/average_pooling1d.py index a4b3a9c6d..7054be73a 100644 --- a/keras/layers/pooling/average_pooling1d.py +++ b/tf_keras/layers/pooling/average_pooling1d.py @@ -17,8 +17,8 @@ import functools -from keras import backend -from keras.layers.pooling.base_pooling1d import Pooling1D +from tf_keras import backend +from tf_keras.layers.pooling.base_pooling1d import Pooling1D # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/pooling/average_pooling2d.py b/tf_keras/layers/pooling/average_pooling2d.py similarity index 97% rename from keras/layers/pooling/average_pooling2d.py rename to tf_keras/layers/pooling/average_pooling2d.py index 662ec9901..e4457d8de 100644 --- a/keras/layers/pooling/average_pooling2d.py +++ b/tf_keras/layers/pooling/average_pooling2d.py @@ -17,7 +17,7 @@ import tensorflow.compat.v2 as tf -from keras.layers.pooling.base_pooling2d import Pooling2D +from tf_keras.layers.pooling.base_pooling2d import Pooling2D # isort: off from tensorflow.python.util.tf_export import keras_export @@ -109,7 +109,7 @@ class AveragePooling2D(Pooling2D): corresponds to inputs with shape `(batch, channels, height, width)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. diff --git a/keras/layers/pooling/average_pooling3d.py b/tf_keras/layers/pooling/average_pooling3d.py similarity index 96% rename from keras/layers/pooling/average_pooling3d.py rename to tf_keras/layers/pooling/average_pooling3d.py index 9d1177e6c..dc9778f4d 100644 --- a/keras/layers/pooling/average_pooling3d.py +++ b/tf_keras/layers/pooling/average_pooling3d.py @@ -17,7 +17,7 @@ import tensorflow.compat.v2 as tf -from keras.layers.pooling.base_pooling3d import Pooling3D +from tf_keras.layers.pooling.base_pooling3d import Pooling3D # isort: off from tensorflow.python.util.tf_export import keras_export @@ -49,7 +49,7 @@ class AveragePooling3D(Pooling3D): while `channels_first` corresponds to inputs with shape `(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. diff --git a/keras/layers/pooling/average_pooling_test.py b/tf_keras/layers/pooling/average_pooling_test.py similarity index 96% rename from keras/layers/pooling/average_pooling_test.py rename to tf_keras/layers/pooling/average_pooling_test.py index cd7f5ffed..555a293ca 100644 --- a/keras/layers/pooling/average_pooling_test.py +++ b/tf_keras/layers/pooling/average_pooling_test.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/layers/pooling/base_global_pooling1d.py b/tf_keras/layers/pooling/base_global_pooling1d.py similarity index 95% rename from keras/layers/pooling/base_global_pooling1d.py rename to tf_keras/layers/pooling/base_global_pooling1d.py index fbf246510..6ea86ed27 100644 --- a/keras/layers/pooling/base_global_pooling1d.py +++ b/tf_keras/layers/pooling/base_global_pooling1d.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils class GlobalPooling1D(Layer): diff --git a/keras/layers/pooling/base_global_pooling2d.py b/tf_keras/layers/pooling/base_global_pooling2d.py similarity index 95% rename from keras/layers/pooling/base_global_pooling2d.py rename to tf_keras/layers/pooling/base_global_pooling2d.py index 7fe7a28e8..0f567ab94 100644 --- a/keras/layers/pooling/base_global_pooling2d.py +++ b/tf_keras/layers/pooling/base_global_pooling2d.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils class GlobalPooling2D(Layer): diff --git a/keras/layers/pooling/base_global_pooling3d.py b/tf_keras/layers/pooling/base_global_pooling3d.py similarity index 95% rename from keras/layers/pooling/base_global_pooling3d.py rename to tf_keras/layers/pooling/base_global_pooling3d.py index 749475ac8..70379780d 100644 --- a/keras/layers/pooling/base_global_pooling3d.py +++ b/tf_keras/layers/pooling/base_global_pooling3d.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils class GlobalPooling3D(Layer): diff --git a/keras/layers/pooling/base_pooling1d.py b/tf_keras/layers/pooling/base_pooling1d.py similarity index 96% rename from keras/layers/pooling/base_pooling1d.py rename to tf_keras/layers/pooling/base_pooling1d.py index 397196d51..f9b538698 100644 --- a/keras/layers/pooling/base_pooling1d.py +++ b/tf_keras/layers/pooling/base_pooling1d.py @@ -17,10 +17,10 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils class Pooling1D(Layer): diff --git a/keras/layers/pooling/base_pooling2d.py b/tf_keras/layers/pooling/base_pooling2d.py similarity index 96% rename from keras/layers/pooling/base_pooling2d.py rename to tf_keras/layers/pooling/base_pooling2d.py index 3aaa08070..f9b14f1c4 100644 --- a/keras/layers/pooling/base_pooling2d.py +++ b/tf_keras/layers/pooling/base_pooling2d.py @@ -17,10 +17,10 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils class Pooling2D(Layer): diff --git a/keras/layers/pooling/base_pooling3d.py b/tf_keras/layers/pooling/base_pooling3d.py similarity index 96% rename from keras/layers/pooling/base_pooling3d.py rename to tf_keras/layers/pooling/base_pooling3d.py index bc4d5b7bd..cb7c1586d 100644 --- a/keras/layers/pooling/base_pooling3d.py +++ b/tf_keras/layers/pooling/base_pooling3d.py @@ -17,10 +17,10 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils class Pooling3D(Layer): diff --git a/keras/layers/pooling/global_average_pooling1d.py b/tf_keras/layers/pooling/global_average_pooling1d.py similarity index 97% rename from keras/layers/pooling/global_average_pooling1d.py rename to tf_keras/layers/pooling/global_average_pooling1d.py index 0a81e9f98..caef85361 100644 --- a/keras/layers/pooling/global_average_pooling1d.py +++ b/tf_keras/layers/pooling/global_average_pooling1d.py @@ -17,8 +17,8 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.layers.pooling.base_global_pooling1d import GlobalPooling1D +from tf_keras import backend +from tf_keras.layers.pooling.base_global_pooling1d import GlobalPooling1D # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/pooling/global_average_pooling2d.py b/tf_keras/layers/pooling/global_average_pooling2d.py similarity index 94% rename from keras/layers/pooling/global_average_pooling2d.py rename to tf_keras/layers/pooling/global_average_pooling2d.py index e219e2414..73831853a 100644 --- a/keras/layers/pooling/global_average_pooling2d.py +++ b/tf_keras/layers/pooling/global_average_pooling2d.py @@ -15,8 +15,8 @@ """Global average pooling 2D layer.""" -from keras import backend -from keras.layers.pooling.base_global_pooling2d import GlobalPooling2D +from tf_keras import backend +from tf_keras.layers.pooling.base_global_pooling2d import GlobalPooling2D # isort: off from tensorflow.python.util.tf_export import keras_export @@ -45,7 +45,7 @@ class GlobalAveragePooling2D(GlobalPooling2D): corresponds to inputs with shape `(batch, channels, height, width)`. When unspecified, uses `image_data_format` value found - in your Keras config file at `~/.keras/keras.json` + in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. keepdims: A boolean, whether to keep the spatial dimensions or not. If `keepdims` is `False` (default), the rank of the tensor is reduced diff --git a/keras/layers/pooling/global_average_pooling3d.py b/tf_keras/layers/pooling/global_average_pooling3d.py similarity index 94% rename from keras/layers/pooling/global_average_pooling3d.py rename to tf_keras/layers/pooling/global_average_pooling3d.py index 04b95667e..46b76d6ea 100644 --- a/keras/layers/pooling/global_average_pooling3d.py +++ b/tf_keras/layers/pooling/global_average_pooling3d.py @@ -15,8 +15,8 @@ """Global average pooling 3D layer.""" -from keras import backend -from keras.layers.pooling.base_global_pooling3d import GlobalPooling3D +from tf_keras import backend +from tf_keras.layers.pooling.base_global_pooling3d import GlobalPooling3D # isort: off from tensorflow.python.util.tf_export import keras_export @@ -37,7 +37,7 @@ class GlobalAveragePooling3D(GlobalPooling3D): while `channels_first` corresponds to inputs with shape `(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. keepdims: A boolean, whether to keep the spatial dimensions or not. diff --git a/keras/layers/pooling/global_average_pooling_test.py b/tf_keras/layers/pooling/global_average_pooling_test.py similarity index 97% rename from keras/layers/pooling/global_average_pooling_test.py rename to tf_keras/layers/pooling/global_average_pooling_test.py index ed33f7c44..cf96f4eb1 100644 --- a/keras/layers/pooling/global_average_pooling_test.py +++ b/tf_keras/layers/pooling/global_average_pooling_test.py @@ -18,10 +18,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.mixed_precision import policy -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.mixed_precision import policy +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/layers/pooling/global_max_pooling1d.py b/tf_keras/layers/pooling/global_max_pooling1d.py similarity index 96% rename from keras/layers/pooling/global_max_pooling1d.py rename to tf_keras/layers/pooling/global_max_pooling1d.py index db84f22eb..1fdd8c2e8 100644 --- a/keras/layers/pooling/global_max_pooling1d.py +++ b/tf_keras/layers/pooling/global_max_pooling1d.py @@ -15,8 +15,8 @@ """Global max pooling 1D layer.""" -from keras import backend -from keras.layers.pooling.base_global_pooling1d import GlobalPooling1D +from tf_keras import backend +from tf_keras.layers.pooling.base_global_pooling1d import GlobalPooling1D # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/pooling/global_max_pooling2d.py b/tf_keras/layers/pooling/global_max_pooling2d.py similarity index 94% rename from keras/layers/pooling/global_max_pooling2d.py rename to tf_keras/layers/pooling/global_max_pooling2d.py index 77ef11b3a..d7588724d 100644 --- a/keras/layers/pooling/global_max_pooling2d.py +++ b/tf_keras/layers/pooling/global_max_pooling2d.py @@ -15,8 +15,8 @@ """Global max pooling 2D layer.""" -from keras import backend -from keras.layers.pooling.base_global_pooling2d import GlobalPooling2D +from tf_keras import backend +from tf_keras.layers.pooling.base_global_pooling2d import GlobalPooling2D # isort: off from tensorflow.python.util.tf_export import keras_export @@ -43,7 +43,7 @@ class GlobalMaxPooling2D(GlobalPooling2D): corresponds to inputs with shape `(batch, channels, height, width)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. keepdims: A boolean, whether to keep the spatial dimensions or not. diff --git a/keras/layers/pooling/global_max_pooling3d.py b/tf_keras/layers/pooling/global_max_pooling3d.py similarity index 94% rename from keras/layers/pooling/global_max_pooling3d.py rename to tf_keras/layers/pooling/global_max_pooling3d.py index f5385fc9b..356a54015 100644 --- a/keras/layers/pooling/global_max_pooling3d.py +++ b/tf_keras/layers/pooling/global_max_pooling3d.py @@ -15,8 +15,8 @@ """Global max pooling 3D layer.""" -from keras import backend -from keras.layers.pooling.base_global_pooling3d import GlobalPooling3D +from tf_keras import backend +from tf_keras.layers.pooling.base_global_pooling3d import GlobalPooling3D # isort: off from tensorflow.python.util.tf_export import keras_export @@ -35,7 +35,7 @@ class GlobalMaxPooling3D(GlobalPooling3D): while `channels_first` corresponds to inputs with shape `(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. keepdims: A boolean, whether to keep the spatial dimensions or not. diff --git a/keras/layers/pooling/global_max_pooling_test.py b/tf_keras/layers/pooling/global_max_pooling_test.py similarity index 97% rename from keras/layers/pooling/global_max_pooling_test.py rename to tf_keras/layers/pooling/global_max_pooling_test.py index ccb59703a..757a6ceb1 100644 --- a/keras/layers/pooling/global_max_pooling_test.py +++ b/tf_keras/layers/pooling/global_max_pooling_test.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/layers/pooling/max_pooling1d.py b/tf_keras/layers/pooling/max_pooling1d.py similarity index 97% rename from keras/layers/pooling/max_pooling1d.py rename to tf_keras/layers/pooling/max_pooling1d.py index 67e915d4b..809be3863 100644 --- a/keras/layers/pooling/max_pooling1d.py +++ b/tf_keras/layers/pooling/max_pooling1d.py @@ -17,8 +17,8 @@ import functools -from keras import backend -from keras.layers.pooling.base_pooling1d import Pooling1D +from tf_keras import backend +from tf_keras.layers.pooling.base_pooling1d import Pooling1D # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/pooling/max_pooling2d.py b/tf_keras/layers/pooling/max_pooling2d.py similarity index 97% rename from keras/layers/pooling/max_pooling2d.py rename to tf_keras/layers/pooling/max_pooling2d.py index f21ab07f2..0d065e75d 100644 --- a/keras/layers/pooling/max_pooling2d.py +++ b/tf_keras/layers/pooling/max_pooling2d.py @@ -17,7 +17,7 @@ import tensorflow.compat.v2 as tf -from keras.layers.pooling.base_pooling2d import Pooling2D +from tf_keras.layers.pooling.base_pooling2d import Pooling2D # isort: off from tensorflow.python.util.tf_export import keras_export @@ -128,7 +128,7 @@ class MaxPooling2D(Pooling2D): corresponds to inputs with shape `(batch, channels, height, width)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. diff --git a/keras/layers/pooling/max_pooling3d.py b/tf_keras/layers/pooling/max_pooling3d.py similarity index 96% rename from keras/layers/pooling/max_pooling3d.py rename to tf_keras/layers/pooling/max_pooling3d.py index 64b257573..115bd6c98 100644 --- a/keras/layers/pooling/max_pooling3d.py +++ b/tf_keras/layers/pooling/max_pooling3d.py @@ -17,7 +17,7 @@ import tensorflow.compat.v2 as tf -from keras.layers.pooling.base_pooling3d import Pooling3D +from tf_keras.layers.pooling.base_pooling3d import Pooling3D # isort: off from tensorflow.python.util.tf_export import keras_export @@ -49,7 +49,7 @@ class MaxPooling3D(Pooling3D): while `channels_first` corresponds to inputs with shape `(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. diff --git a/keras/layers/pooling/max_pooling_test.py b/tf_keras/layers/pooling/max_pooling_test.py similarity index 95% rename from keras/layers/pooling/max_pooling_test.py rename to tf_keras/layers/pooling/max_pooling_test.py index e1e0bc568..746900847 100644 --- a/keras/layers/pooling/max_pooling_test.py +++ b/tf_keras/layers/pooling/max_pooling_test.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/layers/preprocessing/BUILD b/tf_keras/layers/preprocessing/BUILD similarity index 71% rename from keras/layers/preprocessing/BUILD rename to tf_keras/layers/preprocessing/BUILD index 17acbcd0a..e80b66aed 100644 --- a/keras/layers/preprocessing/BUILD +++ b/tf_keras/layers/preprocessing/BUILD @@ -1,17 +1,17 @@ # Description: -# Contains the Keras preprocess layers (internal TensorFlow version). +# Contains the TF-Keras preprocess layers (internal TensorFlow version). # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "cuda_py_test") -load("@org_keras//keras:keras.bzl", "distribute_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "distribute_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/tensorflow/tools/pip_package:__pkg__", ], licenses = ["notice"], @@ -47,8 +47,8 @@ py_library( ":preprocessing_utils", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/engine", - "//keras/utils:tf_utils", + "//tf_keras/engine", + "//tf_keras/utils:tf_utils", ], ) @@ -61,7 +61,7 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/engine", + "//tf_keras/engine", ], ) @@ -74,10 +74,10 @@ py_library( deps = [ ":preprocessing_utils", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:base_preprocessing_layer", - "//keras/utils:layer_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:base_preprocessing_layer", + "//tf_keras/utils:layer_utils", ], ) @@ -90,12 +90,12 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine", - "//keras/engine:input_spec", - "//keras/preprocessing:image", - "//keras/utils:image_utils", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine", + "//tf_keras/engine:input_spec", + "//tf_keras/preprocessing:image", + "//tf_keras/utils:image_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -110,8 +110,8 @@ py_library( ":preprocessing_utils", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine", + "//tf_keras:backend", + "//tf_keras/engine", ], ) @@ -125,8 +125,8 @@ py_library( ":preprocessing_utils", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine", + "//tf_keras:backend", + "//tf_keras/engine", ], ) @@ -139,7 +139,7 @@ py_library( deps = [ ":index_lookup", "//:expect_tensorflow_installed", - "//keras/engine", + "//tf_keras/engine", ], ) @@ -155,10 +155,10 @@ py_library( ":string_lookup", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine", - "//keras/utils:layer_utils", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine", + "//tf_keras/utils:layer_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -171,10 +171,10 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine", - "//keras/engine:input_spec", - "//keras/utils:layer_utils", + "//tf_keras:backend", + "//tf_keras/engine", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:layer_utils", ], ) @@ -187,7 +187,7 @@ py_library( deps = [ ":index_lookup", "//:expect_tensorflow_installed", - "//keras/engine", + "//tf_keras/engine", ], ) @@ -200,8 +200,8 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/engine", - "//keras/utils:tf_utils", + "//tf_keras/engine", + "//tf_keras/utils:tf_utils", ], ) @@ -231,11 +231,11 @@ tf_py_test( python_version = "PY3", deps = [ ":preprocessing_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/utils:generic_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/utils:generic_utils", ], ) @@ -246,11 +246,11 @@ tf_py_test( deps = [ ":category_encoding", ":preprocessing_test_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/utils:generic_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/utils:generic_utils", ], ) @@ -277,10 +277,10 @@ distribute_py_test( ":category_encoding", ":preprocessing_test_utils", "//:expect_tensorflow_installed", - "//keras", - "//keras:backend", - "//keras/distribute:strategy_combinations", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras:backend", + "//tf_keras/distribute:strategy_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -306,9 +306,9 @@ distribute_py_test( ":image_preprocessing", ":preprocessing_test_utils", "//:expect_tensorflow_installed", - "//keras", - "//keras/distribute:strategy_combinations", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/distribute:strategy_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -321,10 +321,10 @@ tf_py_test( deps = [ ":discretization", ":preprocessing_test_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -347,9 +347,9 @@ distribute_py_test( ":discretization", ":preprocessing_test_utils", "//:expect_tensorflow_installed", - "//keras", - "//keras/distribute:strategy_combinations", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/distribute:strategy_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -362,10 +362,10 @@ cuda_py_test( ":hashing", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/engine", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/engine", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -386,9 +386,9 @@ distribute_py_test( deps = [ ":hashing", "//:expect_tensorflow_installed", - "//keras", - "//keras/distribute:strategy_combinations", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/distribute:strategy_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -401,10 +401,10 @@ tf_py_test( ":hashing", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/engine", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/engine", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -417,11 +417,11 @@ tf_py_test( deps = [ ":index_lookup", ":preprocessing_test_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/utils:generic_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/utils:generic_utils", ], ) @@ -443,9 +443,9 @@ distribute_py_test( deps = [ ":index_lookup", "//:expect_tensorflow_installed", - "//keras", - "//keras/distribute:strategy_combinations", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/distribute:strategy_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -459,14 +459,14 @@ cuda_py_test( ], deps = [ ":image_preprocessing", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/engine", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:generic_utils", + "//tf_keras", + "//tf_keras/engine", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:generic_utils", ], ) @@ -481,10 +481,10 @@ tf_py_test( deps = [ ":normalization", ":preprocessing_test_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -496,11 +496,11 @@ tf_py_test( deps = [ ":integer_lookup", ":preprocessing_test_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/utils:generic_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/utils:generic_utils", ], ) @@ -521,9 +521,9 @@ distribute_py_test( ":normalization", ":preprocessing_test_utils", "//:expect_tensorflow_installed", - "//keras", - "//keras/distribute:strategy_combinations", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/distribute:strategy_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -535,11 +535,11 @@ tf_py_test( deps = [ ":preprocessing_test_utils", ":text_vectorization", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/utils:generic_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/utils:generic_utils", ], ) @@ -564,9 +564,9 @@ distribute_py_test( ":preprocessing_test_utils", ":text_vectorization", "//:expect_tensorflow_installed", - "//keras", - "//keras/distribute:strategy_combinations", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/distribute:strategy_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -580,11 +580,11 @@ tf_py_test( deps = [ ":preprocessing_test_utils", ":string_lookup", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/utils:generic_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/utils:generic_utils", ], ) @@ -595,10 +595,10 @@ tf_py_test( tags = ["no_windows"], # TODO(b/152991402) deps = [ ":preprocessing_stage", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/keras/layers/preprocessing/__init__.py b/tf_keras/layers/preprocessing/__init__.py similarity index 100% rename from keras/layers/preprocessing/__init__.py rename to tf_keras/layers/preprocessing/__init__.py diff --git a/keras/layers/preprocessing/benchmarks/BUILD b/tf_keras/layers/preprocessing/benchmarks/BUILD similarity index 78% rename from keras/layers/preprocessing/benchmarks/BUILD rename to tf_keras/layers/preprocessing/benchmarks/BUILD index 66d4bf22a..d247da391 100644 --- a/keras/layers/preprocessing/benchmarks/BUILD +++ b/tf_keras/layers/preprocessing/benchmarks/BUILD @@ -1,15 +1,15 @@ # Placeholder: load unaliased py_library -# Benchmarks for Keras preprocessing layers. -load("@org_keras//keras:keras.bzl", "cuda_py_test") +# Benchmarks for TF-Keras preprocessing layers. +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/tensorflow/tools/pip_package:__pkg__", ], licenses = ["notice"], @@ -21,8 +21,8 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/layers/preprocessing:category_encoding", + "//tf_keras/api:keras_api", + "//tf_keras/layers/preprocessing:category_encoding", ], ) @@ -32,8 +32,8 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/layers/preprocessing:hashing", + "//tf_keras/api:keras_api", + "//tf_keras/layers/preprocessing:hashing", ], ) @@ -43,8 +43,8 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/layers/preprocessing:index_lookup", + "//tf_keras/api:keras_api", + "//tf_keras/layers/preprocessing:index_lookup", ], ) @@ -54,8 +54,8 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/layers/preprocessing:index_lookup", + "//tf_keras/api:keras_api", + "//tf_keras/layers/preprocessing:index_lookup", ], ) @@ -65,8 +65,8 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/layers/preprocessing:normalization", + "//tf_keras/api:keras_api", + "//tf_keras/layers/preprocessing:normalization", ], ) @@ -76,8 +76,8 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/layers/preprocessing:discretization", + "//tf_keras/api:keras_api", + "//tf_keras/layers/preprocessing:discretization", ], ) @@ -87,8 +87,8 @@ cuda_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/layers/preprocessing:image_preprocessing", + "//tf_keras/api:keras_api", + "//tf_keras/layers/preprocessing:image_preprocessing", ], ) @@ -99,7 +99,7 @@ tf_py_test( deps = [ ":feature_column_benchmark", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -110,7 +110,7 @@ tf_py_test( deps = [ ":feature_column_benchmark", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -121,7 +121,7 @@ tf_py_test( deps = [ ":feature_column_benchmark", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -132,7 +132,7 @@ tf_py_test( deps = [ ":feature_column_benchmark", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -144,7 +144,7 @@ tf_py_test( deps = [ ":feature_column_benchmark", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -156,7 +156,7 @@ tf_py_test( deps = [ ":feature_column_benchmark", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -168,7 +168,7 @@ tf_py_test( deps = [ ":feature_column_benchmark", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -180,7 +180,7 @@ tf_py_test( deps = [ ":feature_column_benchmark", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -192,7 +192,7 @@ tf_py_test( deps = [ ":feature_column_benchmark", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -204,7 +204,7 @@ tf_py_test( deps = [ ":feature_column_benchmark", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -215,7 +215,7 @@ tf_py_test( deps = [ ":feature_column_benchmark", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -226,7 +226,7 @@ tf_py_test( deps = [ ":feature_column_benchmark", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -245,6 +245,6 @@ tf_py_test( deps = [ ":feature_column_benchmark", "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) diff --git a/keras/layers/preprocessing/benchmarks/__init__.py b/tf_keras/layers/preprocessing/benchmarks/__init__.py similarity index 100% rename from keras/layers/preprocessing/benchmarks/__init__.py rename to tf_keras/layers/preprocessing/benchmarks/__init__.py diff --git a/keras/layers/preprocessing/benchmarks/bucketized_column_dense_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/bucketized_column_dense_benchmark.py similarity index 94% rename from keras/layers/preprocessing/benchmarks/bucketized_column_dense_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/bucketized_column_dense_benchmark.py index e12ec7ae8..2bf423f25 100644 --- a/keras/layers/preprocessing/benchmarks/bucketized_column_dense_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/bucketized_column_dense_benchmark.py @@ -17,9 +17,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import discretization -from keras.layers.preprocessing.benchmarks import ( +import tf_keras as keras +from tf_keras.layers.preprocessing import discretization +from tf_keras.layers.preprocessing.benchmarks import ( feature_column_benchmark as fc_bm, ) @@ -42,7 +42,7 @@ def embedding_varlen(batch_size, max_length): max_length, batch_size * NUM_REPEATS, 100000, dtype=float ) - # Keras implementation + # TF-Keras implementation model = keras.Sequential() model.add(keras.Input(shape=(max_length,), name="data", dtype=tf.float32)) model.add(discretization.Discretization(bins)) diff --git a/keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py similarity index 94% rename from keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py index 15e2545c7..4e7e53a10 100644 --- a/keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py @@ -12,15 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Benchmark for Keras category_encoding preprocessing layer.""" +"""Benchmark for TF-Keras category_encoding preprocessing layer.""" import time import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import category_encoding +import tf_keras as keras +from tf_keras.layers.preprocessing import category_encoding class BenchmarkLayer(tf.test.Benchmark): diff --git a/keras/layers/preprocessing/benchmarks/category_hash_dense_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/category_hash_dense_benchmark.py similarity index 94% rename from keras/layers/preprocessing/benchmarks/category_hash_dense_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/category_hash_dense_benchmark.py index f4953cc18..2080b3154 100644 --- a/keras/layers/preprocessing/benchmarks/category_hash_dense_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/category_hash_dense_benchmark.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import hashing -from keras.layers.preprocessing.benchmarks import ( +import tf_keras as keras +from tf_keras.layers.preprocessing import hashing +from tf_keras.layers.preprocessing.benchmarks import ( feature_column_benchmark as fc_bm, ) @@ -42,7 +42,7 @@ def embedding_varlen(batch_size, max_length): max_length, batch_size * NUM_REPEATS, vocab, pct_oov=0.0 ) - # Keras implementation + # TF-Keras implementation model = keras.Sequential() model.add(keras.Input(shape=(max_length,), name="data", dtype=tf.string)) model.add(hashing.Hashing(num_buckets)) diff --git a/keras/layers/preprocessing/benchmarks/category_hash_varlen_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/category_hash_varlen_benchmark.py similarity index 94% rename from keras/layers/preprocessing/benchmarks/category_hash_varlen_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/category_hash_varlen_benchmark.py index a43f42a2c..5bbdaf446 100644 --- a/keras/layers/preprocessing/benchmarks/category_hash_varlen_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/category_hash_varlen_benchmark.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import hashing -from keras.layers.preprocessing.benchmarks import ( +import tf_keras as keras +from tf_keras.layers.preprocessing import hashing +from tf_keras.layers.preprocessing.benchmarks import ( feature_column_benchmark as fc_bm, ) @@ -42,7 +42,7 @@ def embedding_varlen(batch_size, max_length): max_length, batch_size * NUM_REPEATS, vocab, pct_oov=0.0 ) - # Keras implementation + # TF-Keras implementation model = keras.Sequential() model.add( keras.Input( diff --git a/keras/layers/preprocessing/benchmarks/category_vocab_file_dense_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/category_vocab_file_dense_benchmark.py similarity index 95% rename from keras/layers/preprocessing/benchmarks/category_vocab_file_dense_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/category_vocab_file_dense_benchmark.py index ae43734f5..98541b0d8 100644 --- a/keras/layers/preprocessing/benchmarks/category_vocab_file_dense_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/category_vocab_file_dense_benchmark.py @@ -19,9 +19,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import string_lookup -from keras.layers.preprocessing.benchmarks import ( +import tf_keras as keras +from tf_keras.layers.preprocessing import string_lookup +from tf_keras.layers.preprocessing.benchmarks import ( feature_column_benchmark as fc_bm, ) @@ -57,7 +57,7 @@ def embedding_varlen(self, batch_size, max_length): max_length, batch_size * NUM_REPEATS, vocab, pct_oov=0.15 ) - # Keras implementation + # TF-Keras implementation model = keras.Sequential() model.add( keras.Input(shape=(max_length,), name="data", dtype=tf.string) diff --git a/keras/layers/preprocessing/benchmarks/category_vocab_file_varlen_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/category_vocab_file_varlen_benchmark.py similarity index 95% rename from keras/layers/preprocessing/benchmarks/category_vocab_file_varlen_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/category_vocab_file_varlen_benchmark.py index 26c6f4861..d87f0c5bb 100644 --- a/keras/layers/preprocessing/benchmarks/category_vocab_file_varlen_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/category_vocab_file_varlen_benchmark.py @@ -19,9 +19,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import string_lookup -from keras.layers.preprocessing.benchmarks import ( +import tf_keras as keras +from tf_keras.layers.preprocessing import string_lookup +from tf_keras.layers.preprocessing.benchmarks import ( feature_column_benchmark as fc_bm, ) @@ -56,7 +56,7 @@ def embedding_varlen(self, batch_size, max_length): max_length, batch_size * NUM_REPEATS, vocab, pct_oov=0.15 ) - # Keras implementation + # TF-Keras implementation model = keras.Sequential() model.add( keras.Input( diff --git a/keras/layers/preprocessing/benchmarks/category_vocab_list_dense_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/category_vocab_list_dense_benchmark.py similarity index 94% rename from keras/layers/preprocessing/benchmarks/category_vocab_list_dense_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/category_vocab_list_dense_benchmark.py index eb455a8e5..47f1deac1 100644 --- a/keras/layers/preprocessing/benchmarks/category_vocab_list_dense_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/category_vocab_list_dense_benchmark.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import string_lookup -from keras.layers.preprocessing.benchmarks import ( +import tf_keras as keras +from tf_keras.layers.preprocessing import string_lookup +from tf_keras.layers.preprocessing.benchmarks import ( feature_column_benchmark as fc_bm, ) @@ -40,7 +40,7 @@ def embedding_varlen(batch_size, max_length): max_length, batch_size * NUM_REPEATS, vocab, pct_oov=0.15 ) - # Keras implementation + # TF-Keras implementation model = keras.Sequential() model.add(keras.Input(shape=(max_length,), name="data", dtype=tf.string)) model.add(string_lookup.StringLookup(vocabulary=vocab, mask_token=None)) diff --git a/keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_dense_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_dense_benchmark.py similarity index 92% rename from keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_dense_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_dense_benchmark.py index b2aa0d687..6a03ba829 100644 --- a/keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_dense_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_dense_benchmark.py @@ -17,10 +17,10 @@ import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import category_encoding -from keras.layers.preprocessing import string_lookup -from keras.layers.preprocessing.benchmarks import ( +import tf_keras as keras +from tf_keras.layers.preprocessing import category_encoding +from tf_keras.layers.preprocessing import string_lookup +from tf_keras.layers.preprocessing.benchmarks import ( feature_column_benchmark as fc_bm, ) @@ -42,7 +42,7 @@ def embedding_varlen(batch_size, max_length): max_length, batch_size * NUM_REPEATS, vocab, pct_oov=0.15 ) - # Keras implementation + # TF-Keras implementation model = keras.Sequential() model.add(keras.Input(shape=(max_length,), name="data", dtype=tf.string)) model.add(string_lookup.StringLookup(vocabulary=vocab, mask_token=None)) diff --git a/keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_varlen_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_varlen_benchmark.py similarity index 92% rename from keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_varlen_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_varlen_benchmark.py index b46b01ebb..d69cb106e 100644 --- a/keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_varlen_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/category_vocab_list_indicator_varlen_benchmark.py @@ -17,10 +17,10 @@ import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import category_encoding -from keras.layers.preprocessing import string_lookup -from keras.layers.preprocessing.benchmarks import ( +import tf_keras as keras +from tf_keras.layers.preprocessing import category_encoding +from tf_keras.layers.preprocessing import string_lookup +from tf_keras.layers.preprocessing.benchmarks import ( feature_column_benchmark as fc_bm, ) @@ -42,7 +42,7 @@ def embedding_varlen(batch_size, max_length): max_length, batch_size * NUM_REPEATS, vocab, pct_oov=0.15 ) - # Keras implementation + # TF-Keras implementation model = keras.Sequential() model.add( keras.Input( diff --git a/keras/layers/preprocessing/benchmarks/category_vocab_list_varlen_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/category_vocab_list_varlen_benchmark.py similarity index 94% rename from keras/layers/preprocessing/benchmarks/category_vocab_list_varlen_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/category_vocab_list_varlen_benchmark.py index 6b1455c5e..e4655ce71 100644 --- a/keras/layers/preprocessing/benchmarks/category_vocab_list_varlen_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/category_vocab_list_varlen_benchmark.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import string_lookup -from keras.layers.preprocessing.benchmarks import ( +import tf_keras as keras +from tf_keras.layers.preprocessing import string_lookup +from tf_keras.layers.preprocessing.benchmarks import ( feature_column_benchmark as fc_bm, ) @@ -40,7 +40,7 @@ def embedding_varlen(batch_size, max_length): max_length, batch_size * NUM_REPEATS, vocab, pct_oov=0.15 ) - # Keras implementation + # TF-Keras implementation model = keras.Sequential() model.add( keras.Input( diff --git a/keras/layers/preprocessing/benchmarks/discretization_adapt_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/discretization_adapt_benchmark.py similarity index 95% rename from keras/layers/preprocessing/benchmarks/discretization_adapt_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/discretization_adapt_benchmark.py index 86af3a658..7c2668315 100644 --- a/keras/layers/preprocessing/benchmarks/discretization_adapt_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/discretization_adapt_benchmark.py @@ -12,15 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Benchmark for Keras discretization preprocessing layer's adapt method.""" +"""Benchmark for TF-Keras discretization preprocessing layer's adapt method.""" import time import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import discretization +import tf_keras as keras +from tf_keras.layers.preprocessing import discretization EPSILON = 0.1 diff --git a/keras/layers/preprocessing/benchmarks/embedding_dense_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/embedding_dense_benchmark.py similarity index 96% rename from keras/layers/preprocessing/benchmarks/embedding_dense_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/embedding_dense_benchmark.py index bbe64c2c8..9d065d908 100644 --- a/keras/layers/preprocessing/benchmarks/embedding_dense_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/embedding_dense_benchmark.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing.benchmarks import ( +import tf_keras as keras +from tf_keras.layers.preprocessing.benchmarks import ( feature_column_benchmark as fc_bm, ) @@ -39,7 +39,7 @@ def embedding_varlen(batch_size, max_length): max_length, batch_size * NUM_REPEATS, embedding_size - 1, dtype=int ) - # Keras implementation + # TF-Keras implementation model = keras.Sequential() model.add(keras.Input(shape=(None,), name="data", dtype=tf.int64)) model.add(keras.layers.Embedding(embedding_size, 256)) diff --git a/keras/layers/preprocessing/benchmarks/embedding_varlen_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/embedding_varlen_benchmark.py similarity index 96% rename from keras/layers/preprocessing/benchmarks/embedding_varlen_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/embedding_varlen_benchmark.py index f7ddbcc3a..757aba3f4 100644 --- a/keras/layers/preprocessing/benchmarks/embedding_varlen_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/embedding_varlen_benchmark.py @@ -17,8 +17,8 @@ import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing.benchmarks import ( +import tf_keras as keras +from tf_keras.layers.preprocessing.benchmarks import ( feature_column_benchmark as fc_bm, ) @@ -40,7 +40,7 @@ def embedding_varlen(batch_size, max_length): max_length, batch_size * NUM_REPEATS, embedding_size - 1, dtype=int ) - # Keras implementation + # TF-Keras implementation model = keras.Sequential() model.add( keras.Input(shape=(None,), ragged=True, name="data", dtype=tf.int64) diff --git a/keras/layers/preprocessing/benchmarks/feature_column_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/feature_column_benchmark.py similarity index 97% rename from keras/layers/preprocessing/benchmarks/feature_column_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/feature_column_benchmark.py index cb14279fc..eb9af6232 100644 --- a/keras/layers/preprocessing/benchmarks/feature_column_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/feature_column_benchmark.py @@ -23,7 +23,7 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras +import tf_keras as keras class LayerBenchmark(tf.test.Benchmark): @@ -43,7 +43,7 @@ def report(self, name, keras_time, fc_time, iters): class StepTimingCallback(keras.callbacks.Callback): - """A callback that times non-warmup steps of a Keras predict call.""" + """A callback that times non-warmup steps of a TF-Keras predict call.""" def __init__(self): self.t0 = None @@ -103,7 +103,7 @@ def create_vocabulary(vocab_size): def run_keras(data, model, batch_size, num_runs, steps_per_repeat=100): - """Benchmark a Keras model.""" + """Benchmark a TF-Keras model.""" ds = ( tf.data.Dataset.from_tensor_slices(data) .repeat() diff --git a/keras/layers/preprocessing/benchmarks/hashed_crossing_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/hashed_crossing_benchmark.py similarity index 94% rename from keras/layers/preprocessing/benchmarks/hashed_crossing_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/hashed_crossing_benchmark.py index 9b0fad90f..7e85fe530 100644 --- a/keras/layers/preprocessing/benchmarks/hashed_crossing_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/hashed_crossing_benchmark.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import hashed_crossing -from keras.layers.preprocessing.benchmarks import ( +import tf_keras as keras +from tf_keras.layers.preprocessing import hashed_crossing +from tf_keras.layers.preprocessing.benchmarks import ( feature_column_benchmark as fc_bm, ) @@ -42,7 +42,7 @@ def embedding_varlen(batch_size): ) data_b = tf.strings.as_string(data_a) - # Keras implementation + # TF-Keras implementation input_1 = keras.Input(shape=(1,), name="data_a", dtype=tf.int64) input_2 = keras.Input(shape=(1,), name="data_b", dtype=tf.string) outputs = hashed_crossing.HashedCrossing(num_buckets)([input_1, input_2]) diff --git a/keras/layers/preprocessing/benchmarks/hashing_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/hashing_benchmark.py similarity index 96% rename from keras/layers/preprocessing/benchmarks/hashing_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/hashing_benchmark.py index 0d0d5b0f8..c6b48a7a4 100644 --- a/keras/layers/preprocessing/benchmarks/hashing_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/hashing_benchmark.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Benchmark for Keras hashing preprocessing layer.""" +"""Benchmark for TF-Keras hashing preprocessing layer.""" import itertools import random @@ -22,8 +22,8 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import hashing +import tf_keras as keras +from tf_keras.layers.preprocessing import hashing # word_gen creates random sequences of ASCII letters (both lowercase and upper). diff --git a/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py similarity index 97% rename from keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py index 895232f22..e7f5bcf7f 100644 --- a/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Benchmark for Keras image preprocessing layer.""" +"""Benchmark for TF-Keras image preprocessing layer.""" import functools import time @@ -20,8 +20,8 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import image_preprocessing +import tf_keras as keras +from tf_keras.layers.preprocessing import image_preprocessing LOWER = 0.2 UPPER = 0.4 diff --git a/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py similarity index 96% rename from keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py index 589f9ab2d..d1ffba116 100644 --- a/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Benchmark for Keras text vectorization preprocessing layer's adapt method.""" +"""Benchmark for TF-Keras text vectorization preprocessing layer's adapt method.""" import collections import itertools @@ -23,8 +23,8 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import index_lookup +import tf_keras as keras +from tf_keras.layers.preprocessing import index_lookup tf.compat.v1.enable_v2_behavior() diff --git a/keras/layers/preprocessing/benchmarks/index_lookup_forward_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/index_lookup_forward_benchmark.py similarity index 96% rename from keras/layers/preprocessing/benchmarks/index_lookup_forward_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/index_lookup_forward_benchmark.py index 659d65569..11eb14114 100644 --- a/keras/layers/preprocessing/benchmarks/index_lookup_forward_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/index_lookup_forward_benchmark.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Benchmark for Keras text vectorization preprocessing layer's adapt method.""" +"""Benchmark for TF-Keras text vectorization preprocessing layer's adapt method.""" import os import random @@ -22,8 +22,8 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import index_lookup +import tf_keras as keras +from tf_keras.layers.preprocessing import index_lookup # word_gen creates random sequences of ASCII letters (both lowercase and upper). diff --git a/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py similarity index 96% rename from keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py index 6d8c50b1a..8e2d34d77 100644 --- a/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py @@ -12,15 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Benchmark for Keras text vectorization preprocessing layer's adapt method.""" +"""Benchmark for TF-Keras text vectorization preprocessing layer's adapt method.""" import time import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import normalization +import tf_keras as keras +from tf_keras.layers.preprocessing import normalization def reduce_fn(state, values): diff --git a/keras/layers/preprocessing/benchmarks/weighted_embedding_varlen_benchmark.py b/tf_keras/layers/preprocessing/benchmarks/weighted_embedding_varlen_benchmark.py similarity index 96% rename from keras/layers/preprocessing/benchmarks/weighted_embedding_varlen_benchmark.py rename to tf_keras/layers/preprocessing/benchmarks/weighted_embedding_varlen_benchmark.py index 6213761e3..4ce720760 100644 --- a/keras/layers/preprocessing/benchmarks/weighted_embedding_varlen_benchmark.py +++ b/tf_keras/layers/preprocessing/benchmarks/weighted_embedding_varlen_benchmark.py @@ -17,8 +17,8 @@ import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing.benchmarks import ( +import tf_keras as keras +from tf_keras.layers.preprocessing.benchmarks import ( feature_column_benchmark as fc_bm, ) @@ -41,7 +41,7 @@ def embedding_varlen(batch_size, max_length): ) weight = tf.ones_like(data, dtype=tf.float32) - # Keras implementation + # TF-Keras implementation data_input = keras.Input( shape=(None,), ragged=True, name="data", dtype=tf.int64 ) diff --git a/keras/layers/preprocessing/category_encoding.py b/tf_keras/layers/preprocessing/category_encoding.py similarity index 96% rename from keras/layers/preprocessing/category_encoding.py rename to tf_keras/layers/preprocessing/category_encoding.py index 5b606616f..e757d71ca 100644 --- a/keras/layers/preprocessing/category_encoding.py +++ b/tf_keras/layers/preprocessing/category_encoding.py @@ -17,11 +17,11 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer -from keras.engine import base_preprocessing_layer -from keras.layers.preprocessing import preprocessing_utils as utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras.engine import base_layer +from tf_keras.engine import base_preprocessing_layer +from tf_keras.layers.preprocessing import preprocessing_utils as utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -47,7 +47,7 @@ class CategoryEncoding(base_layer.Layer): use `tf.keras.layers.IntegerLookup` instead. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Examples: diff --git a/keras/layers/preprocessing/category_encoding_distribution_test.py b/tf_keras/layers/preprocessing/category_encoding_distribution_test.py similarity index 90% rename from keras/layers/preprocessing/category_encoding_distribution_test.py rename to tf_keras/layers/preprocessing/category_encoding_distribution_test.py index 8be4b5cc5..190dd7f69 100644 --- a/keras/layers/preprocessing/category_encoding_distribution_test.py +++ b/tf_keras/layers/preprocessing/category_encoding_distribution_test.py @@ -18,13 +18,13 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras import backend -from keras.distribute import strategy_combinations -from keras.layers.preprocessing import category_encoding -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras import backend +from tf_keras.distribute import strategy_combinations +from tf_keras.layers.preprocessing import category_encoding +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/layers/preprocessing/category_encoding_test.py b/tf_keras/layers/preprocessing/category_encoding_test.py similarity index 98% rename from keras/layers/preprocessing/category_encoding_test.py rename to tf_keras/layers/preprocessing/category_encoding_test.py index ed02ecc76..b3b170dfe 100644 --- a/keras/layers/preprocessing/category_encoding_test.py +++ b/tf_keras/layers/preprocessing/category_encoding_test.py @@ -12,19 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras text category_encoding preprocessing layer.""" +"""Tests for TF-Keras text category_encoding preprocessing layer.""" import numpy as np import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import backend -from keras.layers import core -from keras.layers.preprocessing import category_encoding -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations +import tf_keras as keras +from tf_keras import backend +from tf_keras.layers import core +from tf_keras.layers.preprocessing import category_encoding +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations @test_combinations.run_all_keras_modes(always_skip_v1=True) diff --git a/keras/layers/preprocessing/discretization.py b/tf_keras/layers/preprocessing/discretization.py similarity index 98% rename from keras/layers/preprocessing/discretization.py rename to tf_keras/layers/preprocessing/discretization.py index 72ae53c4e..5f6fbda61 100644 --- a/keras/layers/preprocessing/discretization.py +++ b/tf_keras/layers/preprocessing/discretization.py @@ -18,11 +18,11 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_preprocessing_layer -from keras.layers.preprocessing import preprocessing_utils as utils -from keras.utils import layer_utils -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine import base_preprocessing_layer +from tf_keras.layers.preprocessing import preprocessing_utils as utils +from tf_keras.utils import layer_utils +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -145,7 +145,7 @@ class Discretization(base_preprocessing_layer.PreprocessingLayer): element was placed in. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Input shape: Any `tf.Tensor` or `tf.RaggedTensor` of dimension 2 or higher. diff --git a/keras/layers/preprocessing/discretization_distribution_test.py b/tf_keras/layers/preprocessing/discretization_distribution_test.py similarity index 88% rename from keras/layers/preprocessing/discretization_distribution_test.py rename to tf_keras/layers/preprocessing/discretization_distribution_test.py index ff2d962fe..c99acfbd5 100644 --- a/keras/layers/preprocessing/discretization_distribution_test.py +++ b/tf_keras/layers/preprocessing/discretization_distribution_test.py @@ -18,12 +18,12 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.distribute import strategy_combinations -from keras.layers.preprocessing import discretization -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.distribute import strategy_combinations +from tf_keras.layers.preprocessing import discretization +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_utils.run_v2_only diff --git a/keras/layers/preprocessing/discretization_test.py b/tf_keras/layers/preprocessing/discretization_test.py similarity index 97% rename from keras/layers/preprocessing/discretization_test.py rename to tf_keras/layers/preprocessing/discretization_test.py index 0b4b5e78b..63e45bab1 100644 --- a/keras/layers/preprocessing/discretization_test.py +++ b/tf_keras/layers/preprocessing/discretization_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras discretization preprocessing layer.""" +"""Tests for TF-Keras discretization preprocessing layer.""" import os @@ -20,11 +20,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.preprocessing import discretization -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.layers.preprocessing import discretization +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes @@ -325,7 +325,7 @@ def test_layer_computation( input_shape = tuple(list(test_data.shape)[1:]) np.random.shuffle(adapt_data) if use_dataset: - # Keras APIs expect batched datasets + # TF-Keras APIs expect batched datasets adapt_data = tf.data.Dataset.from_tensor_slices(adapt_data).batch( test_data.shape[0] // 2 ) diff --git a/keras/layers/preprocessing/hashed_crossing.py b/tf_keras/layers/preprocessing/hashed_crossing.py similarity index 96% rename from keras/layers/preprocessing/hashed_crossing.py rename to tf_keras/layers/preprocessing/hashed_crossing.py index 02fa326d3..4d50ceffc 100644 --- a/keras/layers/preprocessing/hashed_crossing.py +++ b/tf_keras/layers/preprocessing/hashed_crossing.py @@ -17,11 +17,11 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer -from keras.engine import base_preprocessing_layer -from keras.layers.preprocessing import preprocessing_utils as utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras.engine import base_layer +from tf_keras.engine import base_preprocessing_layer +from tf_keras.layers.preprocessing import preprocessing_utils as utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -47,7 +47,7 @@ class HashedCrossing(base_layer.Layer): `()`. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: num_bins: Number of hash bins. diff --git a/keras/layers/preprocessing/hashed_crossing_test.py b/tf_keras/layers/preprocessing/hashed_crossing_test.py similarity index 97% rename from keras/layers/preprocessing/hashed_crossing_test.py rename to tf_keras/layers/preprocessing/hashed_crossing_test.py index 6fa5163fb..f2c17e78b 100644 --- a/keras/layers/preprocessing/hashed_crossing_test.py +++ b/tf_keras/layers/preprocessing/hashed_crossing_test.py @@ -20,10 +20,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.preprocessing import hashed_crossing -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations +import tf_keras as keras +from tf_keras.layers.preprocessing import hashed_crossing +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations @test_combinations.run_all_keras_modes(always_skip_v1=True) diff --git a/keras/layers/preprocessing/hashing.py b/tf_keras/layers/preprocessing/hashing.py similarity index 97% rename from keras/layers/preprocessing/hashing.py rename to tf_keras/layers/preprocessing/hashing.py index 77adfee68..d9b6b08fc 100644 --- a/keras/layers/preprocessing/hashing.py +++ b/tf_keras/layers/preprocessing/hashing.py @@ -17,11 +17,11 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer -from keras.engine import base_preprocessing_layer -from keras.layers.preprocessing import preprocessing_utils as utils -from keras.utils import layer_utils +from tf_keras import backend +from tf_keras.engine import base_layer +from tf_keras.engine import base_preprocessing_layer +from tf_keras.layers.preprocessing import preprocessing_utils as utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -54,7 +54,7 @@ class Hashing(base_layer.Layer): the `salt` value serving as additional input to the hash function. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). **Example (FarmHash64)** diff --git a/keras/layers/preprocessing/hashing_distribution_test.py b/tf_keras/layers/preprocessing/hashing_distribution_test.py similarity index 88% rename from keras/layers/preprocessing/hashing_distribution_test.py rename to tf_keras/layers/preprocessing/hashing_distribution_test.py index af6a1fab4..cacb4e75e 100644 --- a/keras/layers/preprocessing/hashing_distribution_test.py +++ b/tf_keras/layers/preprocessing/hashing_distribution_test.py @@ -18,13 +18,13 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras import backend -from keras.distribute import strategy_combinations -from keras.layers.preprocessing import hashing -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras import backend +from tf_keras.distribute import strategy_combinations +from tf_keras.layers.preprocessing import hashing +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/layers/preprocessing/hashing_test.py b/tf_keras/layers/preprocessing/hashing_test.py similarity index 98% rename from keras/layers/preprocessing/hashing_test.py rename to tf_keras/layers/preprocessing/hashing_test.py index 7bb20dc1e..036e0345a 100644 --- a/keras/layers/preprocessing/hashing_test.py +++ b/tf_keras/layers/preprocessing/hashing_test.py @@ -20,13 +20,13 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.engine import input_layer -from keras.engine import training -from keras.layers.preprocessing import hashing -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.engine import input_layer +from tf_keras.engine import training +from tf_keras.layers.preprocessing import hashing +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes(always_skip_v1=True) diff --git a/keras/layers/preprocessing/image_preprocessing.py b/tf_keras/layers/preprocessing/image_preprocessing.py similarity index 98% rename from keras/layers/preprocessing/image_preprocessing.py rename to tf_keras/layers/preprocessing/image_preprocessing.py index b2c74b9f6..a91ac0f2b 100644 --- a/keras/layers/preprocessing/image_preprocessing.py +++ b/tf_keras/layers/preprocessing/image_preprocessing.py @@ -18,12 +18,12 @@ import tensorflow.compat.v2 as tf from tensorflow.python.util.tf_export import keras_export -from keras import backend -from keras.engine import base_layer -from keras.engine import base_preprocessing_layer -from keras.layers.preprocessing import preprocessing_utils as utils -from keras.utils import image_utils -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine import base_layer +from tf_keras.engine import base_preprocessing_layer +from tf_keras.layers.preprocessing import preprocessing_utils as utils +from tf_keras.utils import image_utils +from tf_keras.utils import tf_utils H_AXIS = -3 W_AXIS = -2 @@ -59,7 +59,7 @@ class Resizing(base_layer.Layer): size. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: height: Integer, the height of the output shape. @@ -164,7 +164,7 @@ class CenterCrop(base_layer.Layer): By default, the layer will output floats. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Input shape: 3D (unbatched) or 4D (batched) tensor with shape: @@ -252,7 +252,7 @@ class RandomCrop(base_layer.BaseRandomLayer): floats. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Input shape: 3D (unbatched) or 4D (batched) tensor with shape: @@ -348,7 +348,7 @@ class Rescaling(base_layer.Layer): floats. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Input shape: Arbitrary. @@ -408,7 +408,7 @@ class RandomFlip(base_layer.BaseRandomLayer): By default, the layer will output floats. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Input shape: 3D (unbatched) or 4D (batched) tensor with shape: @@ -512,7 +512,7 @@ class RandomTranslation(base_layer.BaseRandomLayer): floats. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: height_factor: a float represented as fraction of value, or a tuple of @@ -887,7 +887,7 @@ class RandomRotation(base_layer.BaseRandomLayer): By default, the layer will output floats. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Input shape: 3D (unbatched) or 4D (batched) tensor with shape: @@ -1032,7 +1032,7 @@ class RandomZoom(base_layer.BaseRandomLayer): By default, the layer will output floats. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: height_factor: a float represented as fraction of value, @@ -1275,7 +1275,7 @@ class RandomContrast(base_layer.BaseRandomLayer): range of RGB colors. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Input shape: 3D (unbatched) or 4D (batched) tensor with shape: @@ -1364,7 +1364,7 @@ class RandomBrightness(base_layer.BaseRandomLayer): will be apply to each the images in the batch. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: factor: Float or a list/tuple of 2 floats between -1.0 and 1.0. The @@ -1524,7 +1524,7 @@ class RandomHeight(base_layer.BaseRandomLayer): By default, this layer is inactive during inference. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: factor: A positive float (fraction of original height), @@ -1646,7 +1646,7 @@ class RandomWidth(base_layer.BaseRandomLayer): By default, this layer is inactive during inference. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: factor: A positive float (fraction of original width), diff --git a/keras/layers/preprocessing/image_preprocessing_distribution_test.py b/tf_keras/layers/preprocessing/image_preprocessing_distribution_test.py similarity index 90% rename from keras/layers/preprocessing/image_preprocessing_distribution_test.py rename to tf_keras/layers/preprocessing/image_preprocessing_distribution_test.py index 9383de95e..f0c37b428 100644 --- a/keras/layers/preprocessing/image_preprocessing_distribution_test.py +++ b/tf_keras/layers/preprocessing/image_preprocessing_distribution_test.py @@ -17,12 +17,12 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.distribute import strategy_combinations -from keras.layers.preprocessing import image_preprocessing -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.distribute import strategy_combinations +from tf_keras.layers.preprocessing import image_preprocessing +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_utils.run_v2_only diff --git a/keras/layers/preprocessing/image_preprocessing_test.py b/tf_keras/layers/preprocessing/image_preprocessing_test.py similarity index 99% rename from keras/layers/preprocessing/image_preprocessing_test.py rename to tf_keras/layers/preprocessing/image_preprocessing_test.py index 8385e6cda..f42bf75e2 100644 --- a/keras/layers/preprocessing/image_preprocessing_test.py +++ b/tf_keras/layers/preprocessing/image_preprocessing_test.py @@ -20,11 +20,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.engine import sequential -from keras.layers.preprocessing import image_preprocessing -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.engine import sequential +from tf_keras.layers.preprocessing import image_preprocessing +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.ops import stateless_random_ops diff --git a/keras/layers/preprocessing/index_lookup.py b/tf_keras/layers/preprocessing/index_lookup.py similarity index 99% rename from keras/layers/preprocessing/index_lookup.py rename to tf_keras/layers/preprocessing/index_lookup.py index 4747b7ac2..41c534c30 100644 --- a/keras/layers/preprocessing/index_lookup.py +++ b/tf_keras/layers/preprocessing/index_lookup.py @@ -20,13 +20,13 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer_utils -from keras.engine import base_preprocessing_layer -from keras.layers.preprocessing import preprocessing_utils as utils -from keras.saving.legacy.saved_model import layer_serialization -from keras.utils import layer_utils -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine import base_layer_utils +from tf_keras.engine import base_preprocessing_layer +from tf_keras.layers.preprocessing import preprocessing_utils as utils +from tf_keras.saving.legacy.saved_model import layer_serialization +from tf_keras.utils import layer_utils +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -102,7 +102,7 @@ class IndexLookup(base_preprocessing_layer.PreprocessingLayer): This layer translates a set of arbitrary hashables into an integer output via a table-based lookup, with optional out-of-vocabulary handling. This is the basis layer for both IntegerLookup and StringLookup; it holds the common - logic but is not intended to be exported as part of the Keras API. + logic but is not intended to be exported as part of the TF-Keras API. Args: max_tokens: The maximum size of the vocabulary for this layer. If None, diff --git a/keras/layers/preprocessing/index_lookup_distribution_test.py b/tf_keras/layers/preprocessing/index_lookup_distribution_test.py similarity index 95% rename from keras/layers/preprocessing/index_lookup_distribution_test.py rename to tf_keras/layers/preprocessing/index_lookup_distribution_test.py index eb9790b75..2474cff30 100644 --- a/keras/layers/preprocessing/index_lookup_distribution_test.py +++ b/tf_keras/layers/preprocessing/index_lookup_distribution_test.py @@ -20,13 +20,13 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras import backend -from keras.distribute import strategy_combinations -from keras.layers.preprocessing import index_lookup -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras import backend +from tf_keras.distribute import strategy_combinations +from tf_keras.layers.preprocessing import index_lookup +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/layers/preprocessing/index_lookup_test.py b/tf_keras/layers/preprocessing/index_lookup_test.py similarity index 99% rename from keras/layers/preprocessing/index_lookup_test.py rename to tf_keras/layers/preprocessing/index_lookup_test.py index ca488eb4c..fa3b42731 100644 --- a/keras/layers/preprocessing/index_lookup_test.py +++ b/tf_keras/layers/preprocessing/index_lookup_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras text vectorization preprocessing layer.""" +"""Tests for TF-Keras text vectorization preprocessing layer.""" import itertools import math @@ -24,12 +24,12 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.preprocessing import index_lookup -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import CustomObjectScope +import tf_keras as keras +from tf_keras.layers.preprocessing import index_lookup +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import CustomObjectScope def zip_and_sort(weight_values): @@ -514,7 +514,7 @@ def test_layer_end_to_end_with_adapt( input_shape = input_data.shape if use_dataset: - # Keras APIs expect batched datasets. + # TF-Keras APIs expect batched datasets. # TODO(rachelim): `model.predict` predicts the result on each # dataset batch separately, then tries to concatenate the results # together. When the results have different shapes on the non-concat diff --git a/keras/layers/preprocessing/integer_lookup.py b/tf_keras/layers/preprocessing/integer_lookup.py similarity index 99% rename from keras/layers/preprocessing/integer_lookup.py rename to tf_keras/layers/preprocessing/integer_lookup.py index 78601201f..91ed1186d 100644 --- a/keras/layers/preprocessing/integer_lookup.py +++ b/tf_keras/layers/preprocessing/integer_lookup.py @@ -18,8 +18,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.engine import base_preprocessing_layer -from keras.layers.preprocessing import index_lookup +from tf_keras.engine import base_preprocessing_layer +from tf_keras.layers.preprocessing import index_lookup # isort: off from tensorflow.python.platform import tf_logging as logging @@ -64,7 +64,7 @@ class IntegerLookup(index_lookup.IndexLookup): begin with OOV indices and instances of the mask token will be dropped. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: max_tokens: Maximum size of the vocabulary for this layer. This should diff --git a/keras/layers/preprocessing/integer_lookup_test.py b/tf_keras/layers/preprocessing/integer_lookup_test.py similarity index 98% rename from keras/layers/preprocessing/integer_lookup_test.py rename to tf_keras/layers/preprocessing/integer_lookup_test.py index 4a0647588..04c915130 100644 --- a/keras/layers/preprocessing/integer_lookup_test.py +++ b/tf_keras/layers/preprocessing/integer_lookup_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras text vectorization preprocessing layer.""" +"""Tests for TF-Keras text vectorization preprocessing layer.""" import gc import itertools @@ -23,11 +23,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.preprocessing import integer_lookup -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.layers.preprocessing import integer_lookup +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils def _get_end_to_end_test_cases(): @@ -97,7 +97,7 @@ def test_layer_end_to_end_with_adapt( input_shape = input_data.shape if use_dataset: - # Keras APIs expect batched datasets. + # TF-Keras APIs expect batched datasets. # TODO(rachelim): `model.predict` predicts the result on each # dataset batch separately, then tries to concatenate the results # together. When the results have different shapes on the non-concat diff --git a/keras/layers/preprocessing/normalization.py b/tf_keras/layers/preprocessing/normalization.py similarity index 98% rename from keras/layers/preprocessing/normalization.py rename to tf_keras/layers/preprocessing/normalization.py index c105877d8..4e1febd74 100644 --- a/keras/layers/preprocessing/normalization.py +++ b/tf_keras/layers/preprocessing/normalization.py @@ -18,9 +18,9 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_preprocessing_layer -from keras.layers.preprocessing import preprocessing_utils as utils +from tf_keras import backend +from tf_keras.engine import base_preprocessing_layer +from tf_keras.layers.preprocessing import preprocessing_utils as utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -44,7 +44,7 @@ class Normalization(base_preprocessing_layer.PreprocessingLayer): be called before `fit()`, `evaluate()`, or `predict()`. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: axis: Integer, tuple of integers, or None. The axis or axes that should diff --git a/keras/layers/preprocessing/normalization_distribution_test.py b/tf_keras/layers/preprocessing/normalization_distribution_test.py similarity index 93% rename from keras/layers/preprocessing/normalization_distribution_test.py rename to tf_keras/layers/preprocessing/normalization_distribution_test.py index 3d8e08aac..a38de8459 100644 --- a/keras/layers/preprocessing/normalization_distribution_test.py +++ b/tf_keras/layers/preprocessing/normalization_distribution_test.py @@ -18,12 +18,12 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.distribute import strategy_combinations -from keras.layers.preprocessing import normalization -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.distribute import strategy_combinations +from tf_keras.layers.preprocessing import normalization +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils def _get_layer_computation_test_cases(): @@ -141,7 +141,7 @@ def test_layer_computation( ): input_shape = tuple([None for _ in range(test_data.ndim - 1)]) if use_dataset: - # Keras APIs expect batched datasets + # TF-Keras APIs expect batched datasets adapt_data = tf.data.Dataset.from_tensor_slices(adapt_data).batch(2) test_data = tf.data.Dataset.from_tensor_slices(test_data).batch(2) diff --git a/keras/layers/preprocessing/normalization_test.py b/tf_keras/layers/preprocessing/normalization_test.py similarity index 98% rename from keras/layers/preprocessing/normalization_test.py rename to tf_keras/layers/preprocessing/normalization_test.py index d948f34d3..e1c43f711 100644 --- a/keras/layers/preprocessing/normalization_test.py +++ b/tf_keras/layers/preprocessing/normalization_test.py @@ -20,12 +20,12 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.preprocessing import normalization -from keras.layers.preprocessing import preprocessing_test_utils -from keras.mixed_precision import policy -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.layers.preprocessing import normalization +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.mixed_precision import policy +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils def _get_layer_computation_test_cases(): @@ -276,7 +276,7 @@ def test_layer_computation( [test_data.shape[i] for i in range(1, test_data.ndim)] ) if use_dataset: - # Keras APIs expect batched datasets + # TF-Keras APIs expect batched datasets adapt_data = tf.data.Dataset.from_tensor_slices(adapt_data).batch( test_data.shape[0] // 2 ) diff --git a/keras/layers/preprocessing/preprocessing_stage.py b/tf_keras/layers/preprocessing/preprocessing_stage.py similarity index 98% rename from keras/layers/preprocessing/preprocessing_stage.py rename to tf_keras/layers/preprocessing/preprocessing_stage.py index 035f18c16..567a1882a 100644 --- a/keras/layers/preprocessing/preprocessing_stage.py +++ b/tf_keras/layers/preprocessing/preprocessing_stage.py @@ -17,10 +17,10 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.engine import base_preprocessing_layer -from keras.engine import functional -from keras.engine import sequential -from keras.utils import tf_utils +from tf_keras.engine import base_preprocessing_layer +from tf_keras.engine import functional +from tf_keras.engine import sequential +from tf_keras.utils import tf_utils # Sequential methods should take precedence. diff --git a/keras/layers/preprocessing/preprocessing_stage_functional_test.py b/tf_keras/layers/preprocessing/preprocessing_stage_functional_test.py similarity index 96% rename from keras/layers/preprocessing/preprocessing_stage_functional_test.py rename to tf_keras/layers/preprocessing/preprocessing_stage_functional_test.py index 897c1d48e..32f68a96d 100644 --- a/keras/layers/preprocessing/preprocessing_stage_functional_test.py +++ b/tf_keras/layers/preprocessing/preprocessing_stage_functional_test.py @@ -19,16 +19,16 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.engine import base_preprocessing_layer -from keras.engine.input_layer import Input -from keras.layers import convolutional -from keras.layers import core -from keras.layers import merging -from keras.layers.preprocessing import image_preprocessing -from keras.layers.preprocessing import normalization -from keras.layers.preprocessing import preprocessing_stage -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations +from tf_keras.engine import base_preprocessing_layer +from tf_keras.engine.input_layer import Input +from tf_keras.layers import convolutional +from tf_keras.layers import core +from tf_keras.layers import merging +from tf_keras.layers.preprocessing import image_preprocessing +from tf_keras.layers.preprocessing import normalization +from tf_keras.layers.preprocessing import preprocessing_stage +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations class PL(base_preprocessing_layer.PreprocessingLayer): diff --git a/keras/layers/preprocessing/preprocessing_stage_test.py b/tf_keras/layers/preprocessing/preprocessing_stage_test.py similarity index 92% rename from keras/layers/preprocessing/preprocessing_stage_test.py rename to tf_keras/layers/preprocessing/preprocessing_stage_test.py index 5d183d841..da4c5827b 100644 --- a/keras/layers/preprocessing/preprocessing_stage_test.py +++ b/tf_keras/layers/preprocessing/preprocessing_stage_test.py @@ -19,10 +19,10 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.engine import base_preprocessing_layer -from keras.layers.preprocessing import preprocessing_stage -from keras.layers.preprocessing import preprocessing_test_utils -from keras.testing_infra import test_combinations +from tf_keras.engine import base_preprocessing_layer +from tf_keras.layers.preprocessing import preprocessing_stage +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.testing_infra import test_combinations @test_combinations.run_all_keras_modes(always_skip_v1=True) diff --git a/keras/layers/preprocessing/preprocessing_test_utils.py b/tf_keras/layers/preprocessing/preprocessing_test_utils.py similarity index 100% rename from keras/layers/preprocessing/preprocessing_test_utils.py rename to tf_keras/layers/preprocessing/preprocessing_test_utils.py diff --git a/keras/layers/preprocessing/preprocessing_utils.py b/tf_keras/layers/preprocessing/preprocessing_utils.py similarity index 99% rename from keras/layers/preprocessing/preprocessing_utils.py rename to tf_keras/layers/preprocessing/preprocessing_utils.py index b0f7cc945..19ecbaa31 100644 --- a/keras/layers/preprocessing/preprocessing_utils.py +++ b/tf_keras/layers/preprocessing/preprocessing_utils.py @@ -17,7 +17,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.utils import tf_utils +from tf_keras.utils import tf_utils INT = "int" ONE_HOT = "one_hot" diff --git a/keras/layers/preprocessing/preprocessing_utils_test.py b/tf_keras/layers/preprocessing/preprocessing_utils_test.py similarity index 97% rename from keras/layers/preprocessing/preprocessing_utils_test.py rename to tf_keras/layers/preprocessing/preprocessing_utils_test.py index 5e48a0ca1..4aaad2f0d 100644 --- a/keras/layers/preprocessing/preprocessing_utils_test.py +++ b/tf_keras/layers/preprocessing/preprocessing_utils_test.py @@ -18,8 +18,8 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.layers.preprocessing import preprocessing_utils -from keras.testing_infra import test_combinations +from tf_keras.layers.preprocessing import preprocessing_utils +from tf_keras.testing_infra import test_combinations @test_combinations.run_all_keras_modes(always_skip_v1=True) diff --git a/keras/layers/preprocessing/string_lookup.py b/tf_keras/layers/preprocessing/string_lookup.py similarity index 99% rename from keras/layers/preprocessing/string_lookup.py rename to tf_keras/layers/preprocessing/string_lookup.py index 5bf7389b8..99b08fe8c 100644 --- a/keras/layers/preprocessing/string_lookup.py +++ b/tf_keras/layers/preprocessing/string_lookup.py @@ -17,8 +17,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.engine import base_preprocessing_layer -from keras.layers.preprocessing import index_lookup +from tf_keras.engine import base_preprocessing_layer +from tf_keras.layers.preprocessing import index_lookup # isort: off from tensorflow.python.util.tf_export import keras_export @@ -61,7 +61,7 @@ class StringLookup(index_lookup.IndexLookup): OOV indices and instances of the mask token will be dropped. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: max_tokens: Maximum size of the vocabulary for this layer. This should diff --git a/keras/layers/preprocessing/string_lookup_test.py b/tf_keras/layers/preprocessing/string_lookup_test.py similarity index 98% rename from keras/layers/preprocessing/string_lookup_test.py rename to tf_keras/layers/preprocessing/string_lookup_test.py index 0fac8cf28..afb1e9a74 100644 --- a/keras/layers/preprocessing/string_lookup_test.py +++ b/tf_keras/layers/preprocessing/string_lookup_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras text vectorization preprocessing layer.""" +"""Tests for TF-Keras text vectorization preprocessing layer.""" import os @@ -20,11 +20,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.preprocessing import preprocessing_test_utils -from keras.layers.preprocessing import string_lookup -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.layers.preprocessing import string_lookup +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils def _get_end_to_end_test_cases(): @@ -100,7 +100,7 @@ def test_layer_end_to_end_with_adapt( input_shape = input_data.shape if use_dataset: - # Keras APIs expect batched datasets. + # TF-Keras APIs expect batched datasets. # TODO(rachelim): `model.predict` predicts the result on each # dataset batch separately, then tries to concatenate the results # together. When the results have different shapes on the non-concat diff --git a/keras/layers/preprocessing/text_vectorization.py b/tf_keras/layers/preprocessing/text_vectorization.py similarity index 98% rename from keras/layers/preprocessing/text_vectorization.py rename to tf_keras/layers/preprocessing/text_vectorization.py index cd65e21be..8dd6d00ba 100644 --- a/keras/layers/preprocessing/text_vectorization.py +++ b/tf_keras/layers/preprocessing/text_vectorization.py @@ -18,14 +18,14 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_preprocessing_layer -from keras.layers.preprocessing import preprocessing_utils as utils -from keras.layers.preprocessing import string_lookup -from keras.saving.legacy.saved_model import layer_serialization -from keras.saving.serialization_lib import deserialize_keras_object -from keras.utils import layer_utils -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine import base_preprocessing_layer +from tf_keras.layers.preprocessing import preprocessing_utils as utils +from tf_keras.layers.preprocessing import string_lookup +from tf_keras.saving.legacy.saved_model import layer_serialization +from tf_keras.saving.serialization_lib import deserialize_keras_object +from tf_keras.utils import layer_utils +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -56,7 +56,7 @@ class TextVectorization(base_preprocessing_layer.PreprocessingLayer): """A preprocessing layer which maps text features to integer sequences. - This layer has basic options for managing text in a Keras model. It + This layer has basic options for managing text in a TF-Keras model. It transforms a batch of strings (one example = one string) into either a list of token indices (one example = 1D tensor of integer token indices) or a dense representation (one example = 1D tensor of float values representing @@ -101,7 +101,7 @@ class TextVectorization(base_preprocessing_layer.PreprocessingLayer): site natively compatible with `tf.strings.split()`. For an overview and full list of preprocessing layers, see the preprocessing - [guide](https://www.tensorflow.org/guide/keras/preprocessing_layers). + [guide](https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: max_tokens: Maximum size of the vocabulary for this layer. This should diff --git a/keras/layers/preprocessing/text_vectorization_distribution_test.py b/tf_keras/layers/preprocessing/text_vectorization_distribution_test.py similarity index 93% rename from keras/layers/preprocessing/text_vectorization_distribution_test.py rename to tf_keras/layers/preprocessing/text_vectorization_distribution_test.py index 94087acac..be24e4837 100644 --- a/keras/layers/preprocessing/text_vectorization_distribution_test.py +++ b/tf_keras/layers/preprocessing/text_vectorization_distribution_test.py @@ -18,13 +18,13 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras import backend -from keras.distribute import strategy_combinations -from keras.layers.preprocessing import preprocessing_test_utils -from keras.layers.preprocessing import text_vectorization -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras import backend +from tf_keras.distribute import strategy_combinations +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.layers.preprocessing import text_vectorization +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/layers/preprocessing/text_vectorization_test.py b/tf_keras/layers/preprocessing/text_vectorization_test.py similarity index 99% rename from keras/layers/preprocessing/text_vectorization_test.py rename to tf_keras/layers/preprocessing/text_vectorization_test.py index 9a4b85c16..d1ef84a6f 100644 --- a/keras/layers/preprocessing/text_vectorization_test.py +++ b/tf_keras/layers/preprocessing/text_vectorization_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras text vectorization preprocessing layer.""" +"""Tests for TF-Keras text vectorization preprocessing layer.""" import gc import os @@ -21,15 +21,15 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import backend -from keras.layers import convolutional -from keras.layers import core -from keras.layers.preprocessing import preprocessing_test_utils -from keras.layers.preprocessing import text_vectorization -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import register_keras_serializable +import tf_keras as keras +from tf_keras import backend +from tf_keras.layers import convolutional +from tf_keras.layers import core +from tf_keras.layers.preprocessing import preprocessing_test_utils +from tf_keras.layers.preprocessing import text_vectorization +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import register_keras_serializable def _get_end_to_end_test_cases(): @@ -457,7 +457,7 @@ def test_layer_end_to_end_with_adapt( input_shape = input_data.shape if use_dataset: - # Keras APIs expect batched datasets. + # TF-Keras APIs expect batched datasets. # TODO(rachelim): `model.predict` predicts the result on each # dataset batch separately, then tries to concatenate the results # together. When the results have different shapes on the non-concat diff --git a/keras/layers/regularization/BUILD b/tf_keras/layers/regularization/BUILD similarity index 70% rename from keras/layers/regularization/BUILD rename to tf_keras/layers/regularization/BUILD index ac9a82941..8a3750a38 100644 --- a/keras/layers/regularization/BUILD +++ b/tf_keras/layers/regularization/BUILD @@ -1,13 +1,13 @@ # Description: -# Contains the Keras regularization layers. +# Contains the TF-Keras regularization layers. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/py/tensorflow_gnn:__subpackages__", "//third_party/tensorflow/python/distribute:__pkg__", "//third_party/tensorflow/python/feature_column:__pkg__", @@ -40,9 +40,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/utils:control_flow_util", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/utils:control_flow_util", ], ) @@ -53,7 +53,7 @@ py_library( deps = [ ":dropout", "//:expect_tensorflow_installed", - "//keras/engine:input_spec", + "//tf_keras/engine:input_spec", ], ) @@ -64,8 +64,8 @@ py_library( deps = [ ":dropout", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:input_spec", + "//tf_keras:backend", + "//tf_keras/engine:input_spec", ], ) @@ -76,8 +76,8 @@ py_library( deps = [ ":dropout", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:input_spec", + "//tf_keras:backend", + "//tf_keras/engine:input_spec", ], ) @@ -88,9 +88,9 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/utils:tf_utils", ], ) @@ -100,9 +100,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/utils:tf_utils", ], ) @@ -111,8 +111,8 @@ py_library( srcs = ["activity_regularization.py"], srcs_version = "PY3", deps = [ - "//keras:regularizers", - "//keras/engine:base_layer", + "//tf_keras:regularizers", + "//tf_keras/engine:base_layer", ], ) @@ -122,9 +122,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/utils:tf_utils", ], ) @@ -137,9 +137,9 @@ tf_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -151,9 +151,9 @@ tf_py_test( shard_count = 3, deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -165,9 +165,9 @@ tf_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -179,9 +179,9 @@ tf_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -194,8 +194,8 @@ tf_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -207,8 +207,8 @@ tf_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) diff --git a/keras/layers/regularization/__init__.py b/tf_keras/layers/regularization/__init__.py similarity index 56% rename from keras/layers/regularization/__init__.py rename to tf_keras/layers/regularization/__init__.py index 60e910e8e..12bab7f3b 100644 --- a/keras/layers/regularization/__init__.py +++ b/tf_keras/layers/regularization/__init__.py @@ -15,13 +15,13 @@ """Keras regularization layers.""" -from keras.layers.regularization.activity_regularization import ( +from tf_keras.layers.regularization.activity_regularization import ( ActivityRegularization, ) -from keras.layers.regularization.alpha_dropout import AlphaDropout -from keras.layers.regularization.dropout import Dropout -from keras.layers.regularization.gaussian_dropout import GaussianDropout -from keras.layers.regularization.gaussian_noise import GaussianNoise -from keras.layers.regularization.spatial_dropout1d import SpatialDropout1D -from keras.layers.regularization.spatial_dropout2d import SpatialDropout2D -from keras.layers.regularization.spatial_dropout3d import SpatialDropout3D +from tf_keras.layers.regularization.alpha_dropout import AlphaDropout +from tf_keras.layers.regularization.dropout import Dropout +from tf_keras.layers.regularization.gaussian_dropout import GaussianDropout +from tf_keras.layers.regularization.gaussian_noise import GaussianNoise +from tf_keras.layers.regularization.spatial_dropout1d import SpatialDropout1D +from tf_keras.layers.regularization.spatial_dropout2d import SpatialDropout2D +from tf_keras.layers.regularization.spatial_dropout3d import SpatialDropout3D diff --git a/keras/layers/regularization/activity_regularization.py b/tf_keras/layers/regularization/activity_regularization.py similarity index 95% rename from keras/layers/regularization/activity_regularization.py rename to tf_keras/layers/regularization/activity_regularization.py index 977b7d24e..601fa9a2d 100644 --- a/keras/layers/regularization/activity_regularization.py +++ b/tf_keras/layers/regularization/activity_regularization.py @@ -15,8 +15,8 @@ """Contains the ActivityRegularization layer.""" -from keras import regularizers -from keras.engine.base_layer import Layer +from tf_keras import regularizers +from tf_keras.engine.base_layer import Layer # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/regularization/activity_regularization_test.py b/tf_keras/layers/regularization/activity_regularization_test.py similarity index 94% rename from keras/layers/regularization/activity_regularization_test.py rename to tf_keras/layers/regularization/activity_regularization_test.py index a98d57cc0..edc06cffb 100644 --- a/keras/layers/regularization/activity_regularization_test.py +++ b/tf_keras/layers/regularization/activity_regularization_test.py @@ -17,8 +17,8 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations +import tf_keras as keras +from tf_keras.testing_infra import test_combinations @test_combinations.run_all_keras_modes diff --git a/keras/layers/regularization/alpha_dropout.py b/tf_keras/layers/regularization/alpha_dropout.py similarity index 97% rename from keras/layers/regularization/alpha_dropout.py rename to tf_keras/layers/regularization/alpha_dropout.py index 5c00ab347..b2d745fc2 100644 --- a/keras/layers/regularization/alpha_dropout.py +++ b/tf_keras/layers/regularization/alpha_dropout.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine import base_layer +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/regularization/alpha_dropout_test.py b/tf_keras/layers/regularization/alpha_dropout_test.py similarity index 93% rename from keras/layers/regularization/alpha_dropout_test.py rename to tf_keras/layers/regularization/alpha_dropout_test.py index b466acf4f..3f12d267d 100644 --- a/keras/layers/regularization/alpha_dropout_test.py +++ b/tf_keras/layers/regularization/alpha_dropout_test.py @@ -17,9 +17,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/regularization/dropout.py b/tf_keras/layers/regularization/dropout.py similarity index 97% rename from keras/layers/regularization/dropout.py rename to tf_keras/layers/regularization/dropout.py index 17374afcd..3a23e92a3 100644 --- a/keras/layers/regularization/dropout.py +++ b/tf_keras/layers/regularization/dropout.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer -from keras.utils import control_flow_util +from tf_keras import backend +from tf_keras.engine import base_layer +from tf_keras.utils import control_flow_util # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/regularization/dropout_test.py b/tf_keras/layers/regularization/dropout_test.py similarity index 98% rename from keras/layers/regularization/dropout_test.py rename to tf_keras/layers/regularization/dropout_test.py index 2239338b8..80bd2ffe9 100644 --- a/keras/layers/regularization/dropout_test.py +++ b/tf_keras/layers/regularization/dropout_test.py @@ -19,9 +19,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/regularization/gaussian_dropout.py b/tf_keras/layers/regularization/gaussian_dropout.py similarity index 96% rename from keras/layers/regularization/gaussian_dropout.py rename to tf_keras/layers/regularization/gaussian_dropout.py index 9e9d442bb..7e1021376 100644 --- a/keras/layers/regularization/gaussian_dropout.py +++ b/tf_keras/layers/regularization/gaussian_dropout.py @@ -18,9 +18,9 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine import base_layer +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/regularization/gaussian_dropout_test.py b/tf_keras/layers/regularization/gaussian_dropout_test.py similarity index 93% rename from keras/layers/regularization/gaussian_dropout_test.py rename to tf_keras/layers/regularization/gaussian_dropout_test.py index b50d348e2..c5c8242c4 100644 --- a/keras/layers/regularization/gaussian_dropout_test.py +++ b/tf_keras/layers/regularization/gaussian_dropout_test.py @@ -17,9 +17,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/regularization/gaussian_noise.py b/tf_keras/layers/regularization/gaussian_noise.py similarity index 96% rename from keras/layers/regularization/gaussian_noise.py rename to tf_keras/layers/regularization/gaussian_noise.py index f88e3a3c4..91a9bdaf9 100644 --- a/keras/layers/regularization/gaussian_noise.py +++ b/tf_keras/layers/regularization/gaussian_noise.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine import base_layer +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/regularization/gaussian_noise_test.py b/tf_keras/layers/regularization/gaussian_noise_test.py similarity index 93% rename from keras/layers/regularization/gaussian_noise_test.py rename to tf_keras/layers/regularization/gaussian_noise_test.py index b67084e05..04f0a192d 100644 --- a/keras/layers/regularization/gaussian_noise_test.py +++ b/tf_keras/layers/regularization/gaussian_noise_test.py @@ -17,9 +17,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/regularization/spatial_dropout1d.py b/tf_keras/layers/regularization/spatial_dropout1d.py similarity index 95% rename from keras/layers/regularization/spatial_dropout1d.py rename to tf_keras/layers/regularization/spatial_dropout1d.py index 7a3672c9d..14ed7e90f 100644 --- a/keras/layers/regularization/spatial_dropout1d.py +++ b/tf_keras/layers/regularization/spatial_dropout1d.py @@ -17,8 +17,8 @@ import tensorflow.compat.v2 as tf -from keras.engine.input_spec import InputSpec -from keras.layers.regularization.dropout import Dropout +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.regularization.dropout import Dropout # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/regularization/spatial_dropout2d.py b/tf_keras/layers/regularization/spatial_dropout2d.py similarity index 93% rename from keras/layers/regularization/spatial_dropout2d.py rename to tf_keras/layers/regularization/spatial_dropout2d.py index e913c132c..69e0fa51b 100644 --- a/keras/layers/regularization/spatial_dropout2d.py +++ b/tf_keras/layers/regularization/spatial_dropout2d.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.input_spec import InputSpec -from keras.layers.regularization.dropout import Dropout +from tf_keras import backend +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.regularization.dropout import Dropout # isort: off from tensorflow.python.util.tf_export import keras_export @@ -42,7 +42,7 @@ class SpatialDropout2D(Dropout): data_format: 'channels_first' or 'channels_last'. In 'channels_first' mode, the channels dimension (the depth) is at index 1, in 'channels_last' mode is it at index 3. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. Call arguments: diff --git a/keras/layers/regularization/spatial_dropout3d.py b/tf_keras/layers/regularization/spatial_dropout3d.py similarity index 94% rename from keras/layers/regularization/spatial_dropout3d.py rename to tf_keras/layers/regularization/spatial_dropout3d.py index d7dff8724..01e431bee 100644 --- a/keras/layers/regularization/spatial_dropout3d.py +++ b/tf_keras/layers/regularization/spatial_dropout3d.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.input_spec import InputSpec -from keras.layers.regularization.dropout import Dropout +from tf_keras import backend +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.regularization.dropout import Dropout # isort: off from tensorflow.python.util.tf_export import keras_export @@ -42,7 +42,7 @@ class SpatialDropout3D(Dropout): data_format: 'channels_first' or 'channels_last'. In 'channels_first' mode, the channels dimension (the depth) is at index 1, in 'channels_last' mode is it at index 4. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. Call arguments: diff --git a/keras/layers/regularization/spatial_dropout_test.py b/tf_keras/layers/regularization/spatial_dropout_test.py similarity index 93% rename from keras/layers/regularization/spatial_dropout_test.py rename to tf_keras/layers/regularization/spatial_dropout_test.py index 66ac40ec2..9378bf7e8 100644 --- a/keras/layers/regularization/spatial_dropout_test.py +++ b/tf_keras/layers/regularization/spatial_dropout_test.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/reshaping/BUILD b/tf_keras/layers/reshaping/BUILD similarity index 63% rename from keras/layers/reshaping/BUILD rename to tf_keras/layers/reshaping/BUILD index 2f7e2a73d..05829b34e 100644 --- a/keras/layers/reshaping/BUILD +++ b/tf_keras/layers/reshaping/BUILD @@ -1,19 +1,18 @@ # Description: -# Contains the Keras reshaping layers. +# Contains the TF-Keras reshaping layers. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:__subpackages__", + "//tf_keras:__subpackages__", "//third_party/tensorflow/python/distribute:__pkg__", "//third_party/tensorflow/python/feature_column:__pkg__", - "//third_party/tensorflow/python/keras:__subpackages__", "//third_party/tensorflow/python/trackable:__pkg__", "//third_party/tensorflow/tools/pip_package:__pkg__", "//third_party/tensorflow_models/official/projects/residual_mobilenet/modeling/backbones:__pkg__", @@ -50,9 +49,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -62,9 +61,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -74,9 +73,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -87,9 +86,9 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -99,8 +98,8 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/engine:base_layer", - "//keras/engine:input_spec", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", ], ) @@ -110,9 +109,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:input_spec", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", ], ) @@ -123,7 +122,7 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/engine:base_layer", + "//tf_keras/engine:base_layer", ], ) @@ -133,9 +132,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:input_spec", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", ], ) @@ -145,10 +144,10 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -158,10 +157,10 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -171,10 +170,10 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -184,10 +183,10 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -197,10 +196,10 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", ], ) @@ -213,9 +212,9 @@ cuda_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -226,11 +225,11 @@ tf_py_test( python_version = "PY3", shard_count = 3, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -241,11 +240,11 @@ tf_py_test( python_version = "PY3", shard_count = 3, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -256,11 +255,11 @@ tf_py_test( python_version = "PY3", shard_count = 3, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -271,11 +270,11 @@ tf_py_test( python_version = "PY3", shard_count = 3, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -288,9 +287,9 @@ cuda_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -301,11 +300,11 @@ cuda_py_test( python_version = "PY3", shard_count = 8, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) diff --git a/tf_keras/layers/reshaping/__init__.py b/tf_keras/layers/reshaping/__init__.py new file mode 100644 index 000000000..1de9ac6b6 --- /dev/null +++ b/tf_keras/layers/reshaping/__init__.py @@ -0,0 +1,29 @@ +# 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. +# ============================================================================== +"""Keras reshaping layers layers.""" + +from tf_keras.layers.reshaping.cropping1d import Cropping1D +from tf_keras.layers.reshaping.cropping2d import Cropping2D +from tf_keras.layers.reshaping.cropping3d import Cropping3D +from tf_keras.layers.reshaping.flatten import Flatten +from tf_keras.layers.reshaping.permute import Permute +from tf_keras.layers.reshaping.repeat_vector import RepeatVector +from tf_keras.layers.reshaping.reshape import Reshape +from tf_keras.layers.reshaping.up_sampling1d import UpSampling1D +from tf_keras.layers.reshaping.up_sampling2d import UpSampling2D +from tf_keras.layers.reshaping.up_sampling3d import UpSampling3D +from tf_keras.layers.reshaping.zero_padding1d import ZeroPadding1D +from tf_keras.layers.reshaping.zero_padding2d import ZeroPadding2D +from tf_keras.layers.reshaping.zero_padding3d import ZeroPadding3D diff --git a/keras/layers/reshaping/cropping1d.py b/tf_keras/layers/reshaping/cropping1d.py similarity index 95% rename from keras/layers/reshaping/cropping1d.py rename to tf_keras/layers/reshaping/cropping1d.py index 2eb632e38..ac6b4abef 100644 --- a/keras/layers/reshaping/cropping1d.py +++ b/tf_keras/layers/reshaping/cropping1d.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/reshaping/cropping2d.py b/tf_keras/layers/reshaping/cropping2d.py similarity index 97% rename from keras/layers/reshaping/cropping2d.py rename to tf_keras/layers/reshaping/cropping2d.py index 118de07ee..7f00623d0 100644 --- a/keras/layers/reshaping/cropping2d.py +++ b/tf_keras/layers/reshaping/cropping2d.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -58,7 +58,7 @@ class Cropping2D(Layer): corresponds to inputs with shape `(batch_size, channels, height, width)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. diff --git a/keras/layers/reshaping/cropping3d.py b/tf_keras/layers/reshaping/cropping3d.py similarity index 98% rename from keras/layers/reshaping/cropping3d.py rename to tf_keras/layers/reshaping/cropping3d.py index a7d1a933e..b6e239793 100644 --- a/keras/layers/reshaping/cropping3d.py +++ b/tf_keras/layers/reshaping/cropping3d.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -55,7 +55,7 @@ class Cropping3D(Layer): while `channels_first` corresponds to inputs with shape `(batch_size, channels, spatial_dim1, spatial_dim2, spatial_dim3)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. diff --git a/keras/layers/reshaping/cropping_test.py b/tf_keras/layers/reshaping/cropping_test.py similarity index 98% rename from keras/layers/reshaping/cropping_test.py rename to tf_keras/layers/reshaping/cropping_test.py index 69f7a2800..9a516fbeb 100644 --- a/keras/layers/reshaping/cropping_test.py +++ b/tf_keras/layers/reshaping/cropping_test.py @@ -17,9 +17,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/reshaping/flatten.py b/tf_keras/layers/reshaping/flatten.py similarity index 95% rename from keras/layers/reshaping/flatten.py rename to tf_keras/layers/reshaping/flatten.py index 51d3a4fe2..47fccf0e0 100644 --- a/keras/layers/reshaping/flatten.py +++ b/tf_keras/layers/reshaping/flatten.py @@ -21,9 +21,9 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -44,7 +44,7 @@ class Flatten(Layer): `(batch, ..., channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, ...)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. diff --git a/keras/layers/reshaping/flatten_test.py b/tf_keras/layers/reshaping/flatten_test.py similarity index 94% rename from keras/layers/reshaping/flatten_test.py rename to tf_keras/layers/reshaping/flatten_test.py index 92127afff..d7c617fde 100644 --- a/keras/layers/reshaping/flatten_test.py +++ b/tf_keras/layers/reshaping/flatten_test.py @@ -17,9 +17,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/reshaping/permute.py b/tf_keras/layers/reshaping/permute.py similarity index 96% rename from keras/layers/reshaping/permute.py rename to tf_keras/layers/reshaping/permute.py index 590815e9a..3344070f7 100644 --- a/keras/layers/reshaping/permute.py +++ b/tf_keras/layers/reshaping/permute.py @@ -19,8 +19,8 @@ import tensorflow.compat.v2 as tf -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/reshaping/permute_test.py b/tf_keras/layers/reshaping/permute_test.py similarity index 91% rename from keras/layers/reshaping/permute_test.py rename to tf_keras/layers/reshaping/permute_test.py index 1a9e6564c..9ac7ea460 100644 --- a/keras/layers/reshaping/permute_test.py +++ b/tf_keras/layers/reshaping/permute_test.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras permute layer.""" +"""Tests for TF-Keras permute layer.""" import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/reshaping/repeat_vector.py b/tf_keras/layers/reshaping/repeat_vector.py similarity index 94% rename from keras/layers/reshaping/repeat_vector.py rename to tf_keras/layers/reshaping/repeat_vector.py index 46dcb89e1..4dd4ef2de 100644 --- a/keras/layers/reshaping/repeat_vector.py +++ b/tf_keras/layers/reshaping/repeat_vector.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/reshaping/repeat_vector_test.py b/tf_keras/layers/reshaping/repeat_vector_test.py similarity index 91% rename from keras/layers/reshaping/repeat_vector_test.py rename to tf_keras/layers/reshaping/repeat_vector_test.py index f307f308f..ebf600e27 100644 --- a/keras/layers/reshaping/repeat_vector_test.py +++ b/tf_keras/layers/reshaping/repeat_vector_test.py @@ -17,9 +17,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/reshaping/reshape.py b/tf_keras/layers/reshaping/reshape.py similarity index 99% rename from keras/layers/reshaping/reshape.py rename to tf_keras/layers/reshaping/reshape.py index 83bfccf61..f19b3b010 100644 --- a/keras/layers/reshaping/reshape.py +++ b/tf_keras/layers/reshaping/reshape.py @@ -18,7 +18,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.engine.base_layer import Layer +from tf_keras.engine.base_layer import Layer # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/reshaping/reshape_test.py b/tf_keras/layers/reshaping/reshape_test.py similarity index 93% rename from keras/layers/reshaping/reshape_test.py rename to tf_keras/layers/reshaping/reshape_test.py index 0c9d89f73..77b7afb14 100644 --- a/keras/layers/reshaping/reshape_test.py +++ b/tf_keras/layers/reshaping/reshape_test.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/reshaping/up_sampling1d.py b/tf_keras/layers/reshaping/up_sampling1d.py similarity index 95% rename from keras/layers/reshaping/up_sampling1d.py rename to tf_keras/layers/reshaping/up_sampling1d.py index 56b75ef23..6d9157415 100644 --- a/keras/layers/reshaping/up_sampling1d.py +++ b/tf_keras/layers/reshaping/up_sampling1d.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/reshaping/up_sampling2d.py b/tf_keras/layers/reshaping/up_sampling2d.py similarity index 94% rename from keras/layers/reshaping/up_sampling2d.py rename to tf_keras/layers/reshaping/up_sampling2d.py index ccfd2a6cf..1adfe9820 100644 --- a/keras/layers/reshaping/up_sampling2d.py +++ b/tf_keras/layers/reshaping/up_sampling2d.py @@ -17,11 +17,11 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils -from keras.utils import image_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils +from tf_keras.utils import image_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -66,7 +66,7 @@ class UpSampling2D(Layer): corresponds to inputs with shape `(batch_size, channels, height, width)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. interpolation: A string, one of `"area"`, `"bicubic"`, `"bilinear"`, diff --git a/keras/layers/reshaping/up_sampling3d.py b/tf_keras/layers/reshaping/up_sampling3d.py similarity index 95% rename from keras/layers/reshaping/up_sampling3d.py rename to tf_keras/layers/reshaping/up_sampling3d.py index 9482ea1b5..cac953f89 100644 --- a/keras/layers/reshaping/up_sampling3d.py +++ b/tf_keras/layers/reshaping/up_sampling3d.py @@ -17,10 +17,10 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -52,7 +52,7 @@ class UpSampling3D(Layer): while `channels_first` corresponds to inputs with shape `(batch_size, channels, spatial_dim1, spatial_dim2, spatial_dim3)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. diff --git a/keras/layers/reshaping/up_sampling_test.py b/tf_keras/layers/reshaping/up_sampling_test.py similarity index 98% rename from keras/layers/reshaping/up_sampling_test.py rename to tf_keras/layers/reshaping/up_sampling_test.py index 70ed79e63..4ff3d91d3 100644 --- a/keras/layers/reshaping/up_sampling_test.py +++ b/tf_keras/layers/reshaping/up_sampling_test.py @@ -18,9 +18,9 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/layers/reshaping/zero_padding1d.py b/tf_keras/layers/reshaping/zero_padding1d.py similarity index 94% rename from keras/layers/reshaping/zero_padding1d.py rename to tf_keras/layers/reshaping/zero_padding1d.py index 591e5d921..2db2ec694 100644 --- a/keras/layers/reshaping/zero_padding1d.py +++ b/tf_keras/layers/reshaping/zero_padding1d.py @@ -17,10 +17,10 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/reshaping/zero_padding2d.py b/tf_keras/layers/reshaping/zero_padding2d.py similarity index 96% rename from keras/layers/reshaping/zero_padding2d.py rename to tf_keras/layers/reshaping/zero_padding2d.py index a4e4c3e6f..57effa3ea 100644 --- a/keras/layers/reshaping/zero_padding2d.py +++ b/tf_keras/layers/reshaping/zero_padding2d.py @@ -17,10 +17,10 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -75,7 +75,7 @@ class ZeroPadding2D(Layer): corresponds to inputs with shape `(batch_size, channels, height, width)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. diff --git a/keras/layers/reshaping/zero_padding3d.py b/tf_keras/layers/reshaping/zero_padding3d.py similarity index 96% rename from keras/layers/reshaping/zero_padding3d.py rename to tf_keras/layers/reshaping/zero_padding3d.py index 147118afd..aff5f6a9b 100644 --- a/keras/layers/reshaping/zero_padding3d.py +++ b/tf_keras/layers/reshaping/zero_padding3d.py @@ -17,10 +17,10 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.utils import conv_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.utils import conv_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -58,7 +58,7 @@ class ZeroPadding3D(Layer): while `channels_first` corresponds to inputs with shape `(batch_size, channels, spatial_dim1, spatial_dim2, spatial_dim3)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. diff --git a/keras/layers/reshaping/zero_padding_test.py b/tf_keras/layers/reshaping/zero_padding_test.py similarity index 99% rename from keras/layers/reshaping/zero_padding_test.py rename to tf_keras/layers/reshaping/zero_padding_test.py index 4e997658d..bf9782257 100644 --- a/keras/layers/reshaping/zero_padding_test.py +++ b/tf_keras/layers/reshaping/zero_padding_test.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/rnn/BUILD b/tf_keras/layers/rnn/BUILD similarity index 60% rename from keras/layers/rnn/BUILD rename to tf_keras/layers/rnn/BUILD index 5b7ca0279..f26686395 100644 --- a/keras/layers/rnn/BUILD +++ b/tf_keras/layers/rnn/BUILD @@ -1,16 +1,16 @@ # Description: -# Contains the Keras recurrent layers. +# Contains the TF-Keras recurrent layers. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/tensorflow_models/official/projects/residual_mobilenet/modeling/backbones:__pkg__", ], licenses = ["notice"], @@ -48,7 +48,7 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/utils:control_flow_util", + "//tf_keras/utils:control_flow_util", ], ) @@ -58,7 +58,7 @@ py_library( srcs_version = "PY3", deps = [ ":rnn_utils", - "//keras/engine:base_layer", + "//tf_keras/engine:base_layer", ], ) @@ -68,7 +68,7 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -91,14 +91,14 @@ py_library( ":gru_lstm_utils", ":rnn_utils", "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:backend", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/initializers", - "//keras/utils:tf_utils", + "//tf_keras:activations", + "//tf_keras:backend", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + "//tf_keras/utils:tf_utils", ], ) @@ -110,11 +110,11 @@ py_library( ":base_rnn", ":gru", ":rnn_utils", - "//keras:activations", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:input_spec", - "//keras/initializers", + "//tf_keras:activations", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", ], ) @@ -128,14 +128,14 @@ py_library( ":gru_lstm_utils", ":rnn_utils", "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:backend", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/initializers", - "//keras/utils:tf_utils", + "//tf_keras:activations", + "//tf_keras:backend", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + "//tf_keras/utils:tf_utils", ], ) @@ -147,11 +147,11 @@ py_library( ":base_rnn", ":lstm", ":rnn_utils", - "//keras:activations", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:input_spec", - "//keras/initializers", + "//tf_keras:activations", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", ], ) @@ -162,10 +162,10 @@ py_library( deps = [ ":rnn_utils", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/utils:generic_utils", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/utils:generic_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -179,11 +179,11 @@ py_library( ":stacked_rnn_cells", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/saving/legacy/saved_model", - "//keras/utils:generic_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/saving/legacy/saved_model", + "//tf_keras/utils:generic_utils", ], ) @@ -196,14 +196,14 @@ py_library( ":dropout_rnn_cell_mixin", ":rnn_utils", "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:backend", - "//keras:constraints", - "//keras:regularizers", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/initializers", - "//keras/utils:tf_utils", + "//tf_keras:activations", + "//tf_keras:backend", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + "//tf_keras/utils:tf_utils", ], ) @@ -215,12 +215,12 @@ py_library( ":base_rnn", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras:base_layer", - "//keras/engine:input_spec", - "//keras/utils:engine_utils", - "//keras/utils:generic_utils", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:engine_utils", + "//tf_keras/utils:generic_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -232,13 +232,13 @@ py_library( ":base_conv_rnn", ":dropout_rnn_cell_mixin", "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:backend", - "//keras:base_layer", - "//keras:constraints", - "//keras:regularizers", - "//keras/initializers", - "//keras/utils:engine_utils", + "//tf_keras:activations", + "//tf_keras:backend", + "//tf_keras:base_layer", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/initializers", + "//tf_keras/utils:engine_utils", ], ) @@ -276,8 +276,8 @@ py_library( deps = [ ":base_rnn", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:input_spec", + "//tf_keras:backend", + "//tf_keras/engine:input_spec", ], ) @@ -289,9 +289,9 @@ py_library( ":base_cudnn_rnn", ":gru_lstm_utils", "//:expect_tensorflow_installed", - "//keras:constraints", - "//keras:regularizers", - "//keras/initializers", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/initializers", ], ) @@ -303,9 +303,9 @@ py_library( ":base_cudnn_rnn", ":gru_lstm_utils", "//:expect_tensorflow_installed", - "//keras:constraints", - "//keras:regularizers", - "//keras/initializers", + "//tf_keras:constraints", + "//tf_keras:regularizers", + "//tf_keras/initializers", ], ) @@ -317,8 +317,8 @@ py_library( ":abstract_rnn_cell", ":lstm", "//:expect_tensorflow_installed", - "//keras/utils:generic_utils", - "//keras/utils:tf_inspect", + "//tf_keras/utils:generic_utils", + "//tf_keras/utils:tf_inspect", ], ) @@ -339,13 +339,13 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:backend", - "//keras/engine:base_layer_utils", - "//keras/engine:input_spec", - "//keras/initializers", - "//keras/legacy_tf_layers:layers_base", - "//keras/utils:tf_utils", + "//tf_keras:activations", + "//tf_keras:backend", + "//tf_keras/engine:base_layer_utils", + "//tf_keras/engine:input_spec", + "//tf_keras/initializers", + "//tf_keras/legacy_tf_layers:layers_base", + "//tf_keras/utils:tf_utils", ], ) @@ -354,8 +354,8 @@ py_library( srcs = ["base_wrapper.py"], srcs_version = "PY3", deps = [ - "//keras/engine:base_layer", - "//keras/utils:generic_utils", + "//tf_keras/engine:base_layer", + "//tf_keras/utils:generic_utils", ], ) @@ -367,12 +367,12 @@ py_library( ":base_wrapper", ":rnn_utils", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:generic_utils", - "//keras/utils:tf_inspect", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:generic_utils", + "//tf_keras/utils:tf_inspect", + "//tf_keras/utils:tf_utils", ], ) @@ -383,12 +383,12 @@ py_library( deps = [ ":base_wrapper", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/utils:generic_utils", - "//keras/utils:layer_utils", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/utils:generic_utils", + "//tf_keras/utils:layer_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -404,12 +404,12 @@ cuda_py_test( deps = [ ":gru", ":lstm", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -424,13 +424,13 @@ cuda_py_test( ], deps = [ ":gru_lstm_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:np_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:np_utils", ], ) @@ -446,13 +446,13 @@ tf_py_test( deps = [ ":gru", ":gru_v1", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:np_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:np_utils", ], ) @@ -468,13 +468,13 @@ cuda_py_test( ], deps = [ ":gru_lstm_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:np_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:np_utils", ], ) @@ -491,13 +491,13 @@ tf_py_test( deps = [ ":lstm", ":lstm_v1", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:np_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:np_utils", ], ) @@ -516,14 +516,14 @@ tf_py_test( ":legacy_cells", ":lstm", ":lstm_v1", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/engine:base_layer_utils", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:generic_utils", + "//tf_keras", + "//tf_keras/engine:base_layer_utils", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:generic_utils", ], ) @@ -535,12 +535,12 @@ tf_py_test( shard_count = 4, tags = ["notsan"], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -551,12 +551,12 @@ tf_py_test( python_version = "PY3", shard_count = 8, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -571,13 +571,13 @@ cuda_py_test( "no_windows_gpu", ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/optimizers/legacy:optimizers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/optimizers/legacy:optimizers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -593,13 +593,13 @@ tf_py_test( deps = [ ":cell_wrappers", ":legacy_cells", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/layers", - "//keras/legacy_tf_layers:layers_base", - "//keras/testing_infra:test_combinations", - "//keras/utils:generic_utils", + "//tf_keras/layers", + "//tf_keras/legacy_tf_layers:layers_base", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/utils:generic_utils", ], ) @@ -612,9 +612,9 @@ tf_py_test( deps = [ ":legacy_cell_wrappers", ":legacy_cells", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -625,9 +625,9 @@ tf_py_test( python_version = "PY3", shard_count = 4, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -643,15 +643,15 @@ tf_py_test( ], deps = [ ":cell_wrappers", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/engine:base_layer_utils", - "//keras/layers/core", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:generic_utils", + "//tf_keras", + "//tf_keras/engine:base_layer_utils", + "//tf_keras/layers/core", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:generic_utils", ], ) @@ -666,11 +666,11 @@ tf_py_test( "notsan", ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) diff --git a/tf_keras/layers/rnn/__init__.py b/tf_keras/layers/rnn/__init__.py new file mode 100644 index 000000000..460389027 --- /dev/null +++ b/tf_keras/layers/rnn/__init__.py @@ -0,0 +1,73 @@ +# Copyright 2016 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. +# ============================================================================== +"""Keras recurrent layers.""" + +import tensorflow.compat.v2 as tf + +from tf_keras.layers.rnn.abstract_rnn_cell import AbstractRNNCell + +# Recurrent layers. +from tf_keras.layers.rnn.base_rnn import RNN +from tf_keras.layers.rnn.simple_rnn import SimpleRNN +from tf_keras.layers.rnn.simple_rnn import SimpleRNNCell +from tf_keras.layers.rnn.stacked_rnn_cells import StackedRNNCells + +if tf.__internal__.tf2.enabled(): + from tf_keras.layers.rnn.gru import GRU + from tf_keras.layers.rnn.gru import GRUCell + from tf_keras.layers.rnn.gru_v1 import GRU as GRUV1 + from tf_keras.layers.rnn.gru_v1 import GRUCell as GRUCellV1 + from tf_keras.layers.rnn.lstm import LSTM + from tf_keras.layers.rnn.lstm import LSTMCell + from tf_keras.layers.rnn.lstm_v1 import LSTM as LSTMV1 + from tf_keras.layers.rnn.lstm_v1 import LSTMCell as LSTMCellV1 + + GRUV2 = GRU + GRUCellV2 = GRUCell + LSTMV2 = LSTM + LSTMCellV2 = LSTMCell +else: + from tf_keras.layers.rnn.gru import GRU as GRUV2 + from tf_keras.layers.rnn.gru import GRUCell as GRUCellV2 + from tf_keras.layers.rnn.gru_v1 import GRU + from tf_keras.layers.rnn.gru_v1 import GRUCell + from tf_keras.layers.rnn.lstm import LSTM as LSTMV2 + from tf_keras.layers.rnn.lstm import LSTMCell as LSTMCellV2 + from tf_keras.layers.rnn.lstm_v1 import LSTM + from tf_keras.layers.rnn.lstm_v1 import LSTMCell + + GRUV1 = GRU + GRUCellV1 = GRUCell + LSTMV1 = LSTM + LSTMCellV1 = LSTMCell + +# Wrapper functions. +from tf_keras.layers.rnn.base_wrapper import Wrapper +from tf_keras.layers.rnn.bidirectional import Bidirectional + +# RNN Cell wrappers. +from tf_keras.layers.rnn.cell_wrappers import DeviceWrapper +from tf_keras.layers.rnn.cell_wrappers import DropoutWrapper +from tf_keras.layers.rnn.cell_wrappers import ResidualWrapper + +# Convolutional-recurrent layers. +from tf_keras.layers.rnn.conv_lstm1d import ConvLSTM1D +from tf_keras.layers.rnn.conv_lstm2d import ConvLSTM2D +from tf_keras.layers.rnn.conv_lstm3d import ConvLSTM3D +from tf_keras.layers.rnn.cudnn_gru import CuDNNGRU + +# cuDNN recurrent layers. +from tf_keras.layers.rnn.cudnn_lstm import CuDNNLSTM +from tf_keras.layers.rnn.time_distributed import TimeDistributed diff --git a/keras/layers/rnn/abstract_rnn_cell.py b/tf_keras/layers/rnn/abstract_rnn_cell.py similarity index 96% rename from keras/layers/rnn/abstract_rnn_cell.py rename to tf_keras/layers/rnn/abstract_rnn_cell.py index d097947a2..ffe7da814 100644 --- a/keras/layers/rnn/abstract_rnn_cell.py +++ b/tf_keras/layers/rnn/abstract_rnn_cell.py @@ -15,8 +15,8 @@ """Base class for RNN cells.""" -from keras.engine import base_layer -from keras.layers.rnn import rnn_utils +from tf_keras.engine import base_layer +from tf_keras.layers.rnn import rnn_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -26,7 +26,7 @@ class AbstractRNNCell(base_layer.Layer): """Abstract object representing an RNN cell. - See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) + See [the TF-Keras RNN API guide](https://www.tensorflow.org/guide/tf_keras/rnn) for details about the usage of RNN API. This is the base class for implementing RNN cells with custom behavior. diff --git a/keras/layers/rnn/base_conv_lstm.py b/tf_keras/layers/rnn/base_conv_lstm.py similarity index 97% rename from keras/layers/rnn/base_conv_lstm.py rename to tf_keras/layers/rnn/base_conv_lstm.py index b3280d5ac..c03e75029 100644 --- a/keras/layers/rnn/base_conv_lstm.py +++ b/tf_keras/layers/rnn/base_conv_lstm.py @@ -17,15 +17,15 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine import base_layer -from keras.layers.rnn.base_conv_rnn import ConvRNN -from keras.layers.rnn.dropout_rnn_cell_mixin import DropoutRNNCellMixin -from keras.utils import conv_utils +from tf_keras import activations +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine import base_layer +from tf_keras.layers.rnn.base_conv_rnn import ConvRNN +from tf_keras.layers.rnn.dropout_rnn_cell_mixin import DropoutRNNCellMixin +from tf_keras.utils import conv_utils class ConvLSTMCell(DropoutRNNCellMixin, base_layer.BaseRandomLayer): @@ -46,7 +46,7 @@ class ConvLSTMCell(DropoutRNNCellMixin, base_layer.BaseRandomLayer): dimension as the input. data_format: A string, one of `channels_last` (default) or `channels_first`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. dilation_rate: An integer or tuple/list of n integers, specifying the @@ -385,7 +385,7 @@ class ConvLSTM(ConvRNN): while `channels_first` corresponds to inputs with shape `(batch, time, channels, ...)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. dilation_rate: An integer or tuple/list of n integers, specifying diff --git a/keras/layers/rnn/base_conv_rnn.py b/tf_keras/layers/rnn/base_conv_rnn.py similarity index 98% rename from keras/layers/rnn/base_conv_rnn.py rename to tf_keras/layers/rnn/base_conv_rnn.py index bdeef1155..d395258c3 100644 --- a/keras/layers/rnn/base_conv_rnn.py +++ b/tf_keras/layers/rnn/base_conv_rnn.py @@ -18,13 +18,13 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer -from keras.engine.input_spec import InputSpec -from keras.layers.rnn.base_rnn import RNN -from keras.utils import conv_utils -from keras.utils import generic_utils -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine import base_layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.rnn.base_rnn import RNN +from tf_keras.utils import conv_utils +from tf_keras.utils import generic_utils +from tf_keras.utils import tf_utils class ConvRNN(RNN): diff --git a/keras/layers/rnn/base_cudnn_rnn.py b/tf_keras/layers/rnn/base_cudnn_rnn.py similarity index 97% rename from keras/layers/rnn/base_cudnn_rnn.py rename to tf_keras/layers/rnn/base_cudnn_rnn.py index 96426fc72..6e0eccbea 100644 --- a/keras/layers/rnn/base_cudnn_rnn.py +++ b/tf_keras/layers/rnn/base_cudnn_rnn.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.input_spec import InputSpec -from keras.layers.rnn.base_rnn import RNN +from tf_keras import backend +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.rnn.base_rnn import RNN class _CuDNNRNN(RNN): diff --git a/keras/layers/rnn/base_rnn.py b/tf_keras/layers/rnn/base_rnn.py similarity index 97% rename from keras/layers/rnn/base_rnn.py rename to tf_keras/layers/rnn/base_rnn.py index 350dcd1dd..8d22521fc 100644 --- a/keras/layers/rnn/base_rnn.py +++ b/tf_keras/layers/rnn/base_rnn.py @@ -20,15 +20,15 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer -from keras.engine.input_spec import InputSpec -from keras.layers.rnn import rnn_utils -from keras.layers.rnn.dropout_rnn_cell_mixin import DropoutRNNCellMixin -from keras.layers.rnn.stacked_rnn_cells import StackedRNNCells -from keras.saving import serialization_lib -from keras.saving.legacy.saved_model import layer_serialization -from keras.utils import generic_utils +from tf_keras import backend +from tf_keras.engine import base_layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.rnn import rnn_utils +from tf_keras.layers.rnn.dropout_rnn_cell_mixin import DropoutRNNCellMixin +from tf_keras.layers.rnn.stacked_rnn_cells import StackedRNNCells +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy.saved_model import layer_serialization +from tf_keras.utils import generic_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -39,7 +39,7 @@ class RNN(base_layer.Layer): """Base class for recurrent layers. - See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) + See [the TF-Keras RNN API guide](https://www.tensorflow.org/guide/tf_keras/rnn) for details about the usage of RNN API. Args: @@ -187,8 +187,8 @@ class RNN(base_layer.Layer): Examples: ```python - from keras.layers import RNN - from keras import backend + from tf_keras.layers import RNN + from tf_keras import backend # First, let's define a RNN Cell, as a layer subclass. class MinimalRNNCell(keras.layers.Layer): @@ -539,7 +539,7 @@ def get_initial_state(self, inputs): init_state = rnn_utils.generate_zero_filled_state( batch_size, self.cell.state_size, dtype ) - # Keras RNN expect the states in a list, even if it's a single state + # TF-Keras RNN expect the states in a list, even if it's a single state # tensor. if not tf.nest.is_nested(init_state): init_state = [init_state] @@ -587,9 +587,9 @@ def __call__(self, inputs, initial_state=None, constants=None, **kwargs): if backend.is_keras_tensor(tensor) != is_keras_tensor: raise ValueError( "The initial state or constants of an RNN layer cannot be " - "specified via a mix of Keras tensors and non-Keras " + "specified via a mix of TF-Keras tensors and non-Keras " 'tensors (a "Keras tensor" is a tensor that was returned ' - "by a Keras layer or by `Input` during Functional " + "by a TF-Keras layer or by `Input` during Functional " "model construction). Received: " f"initial_state={initial_state}, constants={constants}" ) @@ -964,7 +964,7 @@ def get_config(self): @classmethod def from_config(cls, config, custom_objects=None): - from keras.layers import deserialize as deserialize_layer + from tf_keras.layers import deserialize as deserialize_layer cell = deserialize_layer( config.pop("cell"), custom_objects=custom_objects diff --git a/keras/layers/rnn/base_rnn_test.py b/tf_keras/layers/rnn/base_rnn_test.py similarity index 99% rename from keras/layers/rnn/base_rnn_test.py rename to tf_keras/layers/rnn/base_rnn_test.py index 7b0182a15..da21673f1 100644 --- a/keras/layers/rnn/base_rnn_test.py +++ b/tf_keras/layers/rnn/base_rnn_test.py @@ -24,14 +24,14 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.engine import base_layer_utils -from keras.layers.rnn import gru -from keras.layers.rnn import gru_v1 -from keras.layers.rnn import lstm -from keras.layers.rnn import lstm_v1 -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.engine import base_layer_utils +from tf_keras.layers.rnn import gru +from tf_keras.layers.rnn import gru_v1 +from tf_keras.layers.rnn import lstm +from tf_keras.layers.rnn import lstm_v1 +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.checkpoint import ( diff --git a/keras/layers/rnn/base_wrapper.py b/tf_keras/layers/rnn/base_wrapper.py similarity index 90% rename from keras/layers/rnn/base_wrapper.py rename to tf_keras/layers/rnn/base_wrapper.py index 6058d85fa..804bfad4f 100644 --- a/keras/layers/rnn/base_wrapper.py +++ b/tf_keras/layers/rnn/base_wrapper.py @@ -20,9 +20,9 @@ import copy -from keras.engine.base_layer import Layer -from keras.saving import serialization_lib -from keras.saving.legacy import serialization as legacy_serialization +from tf_keras.engine.base_layer import Layer +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy import serialization as legacy_serialization # isort: off from tensorflow.python.util.tf_export import keras_export @@ -47,7 +47,7 @@ def __init__(self, layer, **kwargs): raise ValueError( f"Layer {layer} supplied to wrapper is" " not a supported layer type. Please" - " ensure wrapped layer is a valid Keras layer." + " ensure wrapped layer is a valid TF-Keras layer." ) self.layer = layer super().__init__(**kwargs) @@ -79,7 +79,7 @@ def get_config(self): @classmethod def from_config(cls, config, custom_objects=None): - from keras.layers import deserialize as deserialize_layer + from tf_keras.layers import deserialize as deserialize_layer # Avoid mutating the input dict config = copy.deepcopy(config) diff --git a/keras/layers/rnn/base_wrapper_test.py b/tf_keras/layers/rnn/base_wrapper_test.py similarity index 98% rename from keras/layers/rnn/base_wrapper_test.py rename to tf_keras/layers/rnn/base_wrapper_test.py index cd019a5f7..c5e5f071c 100644 --- a/keras/layers/rnn/base_wrapper_test.py +++ b/tf_keras/layers/rnn/base_wrapper_test.py @@ -17,7 +17,7 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras +import tf_keras as keras class ExampleWrapper(keras.layers.Wrapper): diff --git a/keras/layers/rnn/bidirectional.py b/tf_keras/layers/rnn/bidirectional.py similarity index 97% rename from keras/layers/rnn/bidirectional.py rename to tf_keras/layers/rnn/bidirectional.py index 3a2d30536..22c460881 100644 --- a/keras/layers/rnn/bidirectional.py +++ b/tf_keras/layers/rnn/bidirectional.py @@ -19,15 +19,15 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.layers.rnn import rnn_utils -from keras.layers.rnn.base_wrapper import Wrapper -from keras.saving import serialization_lib -from keras.utils import generic_utils -from keras.utils import tf_inspect -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.rnn import rnn_utils +from tf_keras.layers.rnn.base_wrapper import Wrapper +from tf_keras.saving import serialization_lib +from tf_keras.utils import generic_utils +from tf_keras.utils import tf_inspect +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -324,9 +324,9 @@ def __call__(self, inputs, initial_state=None, constants=None, **kwargs): raise ValueError( "The initial state of a Bidirectional" " layer cannot be specified with a mix of" - " Keras tensors and non-Keras tensors" + " TF-Keras tensors and non-Keras tensors" ' (a "Keras tensor" is a tensor that was' - " returned by a Keras layer, or by `Input`)" + " returned by a TF-Keras layer, or by `Input`)" ) if is_keras_tensor: @@ -515,7 +515,7 @@ def from_config(cls, config, custom_objects=None): config = copy.deepcopy(config) num_constants = config.pop("num_constants", 0) # Handle forward layer instantiation (as would parent class). - from keras.layers import deserialize as deserialize_layer + from tf_keras.layers import deserialize as deserialize_layer config["layer"] = deserialize_layer( config["layer"], custom_objects=custom_objects diff --git a/keras/layers/rnn/bidirectional_test.py b/tf_keras/layers/rnn/bidirectional_test.py similarity index 99% rename from keras/layers/rnn/bidirectional_test.py rename to tf_keras/layers/rnn/bidirectional_test.py index cc97f2c1b..f7ecef224 100644 --- a/keras/layers/rnn/bidirectional_test.py +++ b/tf_keras/layers/rnn/bidirectional_test.py @@ -21,12 +21,12 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.engine import base_layer_utils -from keras.layers import core -from keras.layers.rnn.cell_wrappers import ResidualWrapper -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.engine import base_layer_utils +from tf_keras.layers import core +from tf_keras.layers.rnn.cell_wrappers import ResidualWrapper +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.checkpoint import ( diff --git a/keras/layers/rnn/cell_wrappers.py b/tf_keras/layers/rnn/cell_wrappers.py similarity index 98% rename from keras/layers/rnn/cell_wrappers.py rename to tf_keras/layers/rnn/cell_wrappers.py index 596c5e16a..639d4a5c1 100644 --- a/keras/layers/rnn/cell_wrappers.py +++ b/tf_keras/layers/rnn/cell_wrappers.py @@ -19,7 +19,7 @@ # to the fact that those APIs were from tf.nn.rnn_cell_impl. They are ported # here to avoid the cyclic dependency issue for serialization. These APIs will # probably be deprecated and removed in future since similar API is available in -# existing Keras RNN API. +# existing TF-Keras RNN API. import hashlib import numbers @@ -29,11 +29,11 @@ import tensorflow.compat.v2 as tf -from keras.layers.rnn import lstm -from keras.layers.rnn.abstract_rnn_cell import AbstractRNNCell -from keras.saving import serialization_lib -from keras.utils import generic_utils -from keras.utils import tf_inspect +from tf_keras.layers.rnn import lstm +from tf_keras.layers.rnn.abstract_rnn_cell import AbstractRNNCell +from tf_keras.saving import serialization_lib +from tf_keras.utils import generic_utils +from tf_keras.utils import tf_inspect # isort: off from tensorflow.python.util.tf_export import tf_export @@ -136,7 +136,7 @@ def get_config(self): @classmethod def from_config(cls, config, custom_objects=None): config = config.copy() - from keras.layers.serialization import deserialize as deserialize_layer + from tf_keras.layers.serialization import deserialize as deserialize_layer cell = deserialize_layer( config.pop("cell"), custom_objects=custom_objects diff --git a/keras/layers/rnn/cell_wrappers_test.py b/tf_keras/layers/rnn/cell_wrappers_test.py similarity index 97% rename from keras/layers/rnn/cell_wrappers_test.py rename to tf_keras/layers/rnn/cell_wrappers_test.py index e8683a7f2..6ccbce02d 100644 --- a/keras/layers/rnn/cell_wrappers_test.py +++ b/tf_keras/layers/rnn/cell_wrappers_test.py @@ -18,12 +18,12 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import layers -from keras.layers.rnn import cell_wrappers -from keras.layers.rnn import legacy_cells -from keras.legacy_tf_layers import base as legacy_base_layer -from keras.testing_infra import test_combinations -from keras.utils import generic_utils +from tf_keras import layers +from tf_keras.layers.rnn import cell_wrappers +from tf_keras.layers.rnn import legacy_cells +from tf_keras.legacy_tf_layers import base as legacy_base_layer +from tf_keras.testing_infra import test_combinations +from tf_keras.utils import generic_utils @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/layers/rnn/conv_lstm1d.py b/tf_keras/layers/rnn/conv_lstm1d.py similarity index 98% rename from keras/layers/rnn/conv_lstm1d.py rename to tf_keras/layers/rnn/conv_lstm1d.py index 96d3c2837..79136fae0 100644 --- a/keras/layers/rnn/conv_lstm1d.py +++ b/tf_keras/layers/rnn/conv_lstm1d.py @@ -15,7 +15,7 @@ """1D Convolutional LSTM layer.""" -from keras.layers.rnn.base_conv_lstm import ConvLSTM +from tf_keras.layers.rnn.base_conv_lstm import ConvLSTM # isort: off from tensorflow.python.util.tf_export import keras_export @@ -45,7 +45,7 @@ class ConvLSTM1D(ConvLSTM): `channels_last` corresponds to inputs with shape `(batch, time, ..., channels)` while `channels_first` corresponds to inputs with shape `(batch, time, channels, ...)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. dilation_rate: An integer or tuple/list of n integers, specifying the diff --git a/keras/layers/rnn/conv_lstm2d.py b/tf_keras/layers/rnn/conv_lstm2d.py similarity index 98% rename from keras/layers/rnn/conv_lstm2d.py rename to tf_keras/layers/rnn/conv_lstm2d.py index 668c9da5e..e3a7ee36a 100644 --- a/keras/layers/rnn/conv_lstm2d.py +++ b/tf_keras/layers/rnn/conv_lstm2d.py @@ -15,7 +15,7 @@ """2D Convolutional LSTM layer.""" -from keras.layers.rnn.base_conv_lstm import ConvLSTM +from tf_keras.layers.rnn.base_conv_lstm import ConvLSTM # isort: off from tensorflow.python.util.tf_export import keras_export @@ -45,7 +45,7 @@ class ConvLSTM2D(ConvLSTM): `channels_last` corresponds to inputs with shape `(batch, time, ..., channels)` while `channels_first` corresponds to inputs with shape `(batch, time, channels, ...)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. dilation_rate: An integer or tuple/list of n integers, specifying the diff --git a/keras/layers/rnn/conv_lstm3d.py b/tf_keras/layers/rnn/conv_lstm3d.py similarity index 98% rename from keras/layers/rnn/conv_lstm3d.py rename to tf_keras/layers/rnn/conv_lstm3d.py index 1488faae7..9576473e9 100644 --- a/keras/layers/rnn/conv_lstm3d.py +++ b/tf_keras/layers/rnn/conv_lstm3d.py @@ -15,7 +15,7 @@ """3D Convolutional LSTM layer.""" -from keras.layers.rnn.base_conv_lstm import ConvLSTM +from tf_keras.layers.rnn.base_conv_lstm import ConvLSTM # isort: off from tensorflow.python.util.tf_export import keras_export @@ -45,7 +45,7 @@ class ConvLSTM3D(ConvLSTM): `channels_last` corresponds to inputs with shape `(batch, time, ..., channels)` while `channels_first` corresponds to inputs with shape `(batch, time, channels, ...)`. When unspecified, uses - `image_data_format` value found in your Keras config file at + `image_data_format` value found in your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to 'channels_last'. dilation_rate: An integer or tuple/list of n integers, specifying the diff --git a/keras/layers/rnn/conv_lstm_test.py b/tf_keras/layers/rnn/conv_lstm_test.py similarity index 99% rename from keras/layers/rnn/conv_lstm_test.py rename to tf_keras/layers/rnn/conv_lstm_test.py index d8dfdeda2..52b7cf29a 100644 --- a/keras/layers/rnn/conv_lstm_test.py +++ b/tf_keras/layers/rnn/conv_lstm_test.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/rnn/cudnn_gru.py b/tf_keras/layers/rnn/cudnn_gru.py similarity index 97% rename from keras/layers/rnn/cudnn_gru.py rename to tf_keras/layers/rnn/cudnn_gru.py index 45c7c91d5..ea9fb56d5 100644 --- a/keras/layers/rnn/cudnn_gru.py +++ b/tf_keras/layers/rnn/cudnn_gru.py @@ -19,11 +19,11 @@ import tensorflow.compat.v2 as tf -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.layers.rnn import gru_lstm_utils -from keras.layers.rnn.base_cudnn_rnn import _CuDNNRNN +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.layers.rnn import gru_lstm_utils +from tf_keras.layers.rnn.base_cudnn_rnn import _CuDNNRNN # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/rnn/cudnn_lstm.py b/tf_keras/layers/rnn/cudnn_lstm.py similarity index 97% rename from keras/layers/rnn/cudnn_lstm.py rename to tf_keras/layers/rnn/cudnn_lstm.py index 69ae8e96a..a1a6832c5 100644 --- a/keras/layers/rnn/cudnn_lstm.py +++ b/tf_keras/layers/rnn/cudnn_lstm.py @@ -19,11 +19,11 @@ import tensorflow.compat.v2 as tf -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.layers.rnn import gru_lstm_utils -from keras.layers.rnn.base_cudnn_rnn import _CuDNNRNN +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.layers.rnn import gru_lstm_utils +from tf_keras.layers.rnn.base_cudnn_rnn import _CuDNNRNN # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/rnn/cudnn_test.py b/tf_keras/layers/rnn/cudnn_test.py similarity index 99% rename from keras/layers/rnn/cudnn_test.py rename to tf_keras/layers/rnn/cudnn_test.py index 8e4a67c1e..cfba694cc 100644 --- a/keras/layers/rnn/cudnn_test.py +++ b/tf_keras/layers/rnn/cudnn_test.py @@ -21,10 +21,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.optimizers.legacy.rmsprop import RMSprop -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.optimizers.legacy.rmsprop import RMSprop +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/layers/rnn/dropout_rnn_cell_mixin.py b/tf_keras/layers/rnn/dropout_rnn_cell_mixin.py similarity index 99% rename from keras/layers/rnn/dropout_rnn_cell_mixin.py rename to tf_keras/layers/rnn/dropout_rnn_cell_mixin.py index d2ee109fc..cb9689319 100644 --- a/keras/layers/rnn/dropout_rnn_cell_mixin.py +++ b/tf_keras/layers/rnn/dropout_rnn_cell_mixin.py @@ -18,7 +18,7 @@ import tensorflow.compat.v2 as tf from tensorflow.tools.docs import doc_controls -from keras import backend +from tf_keras import backend @doc_controls.do_not_generate_docs diff --git a/keras/layers/rnn/gru.py b/tf_keras/layers/rnn/gru.py similarity index 98% rename from keras/layers/rnn/gru.py rename to tf_keras/layers/rnn/gru.py index 855b2561c..9b12bdbaa 100644 --- a/keras/layers/rnn/gru.py +++ b/tf_keras/layers/rnn/gru.py @@ -19,18 +19,18 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine import base_layer -from keras.engine.input_spec import InputSpec -from keras.layers.rnn import gru_lstm_utils -from keras.layers.rnn import rnn_utils -from keras.layers.rnn.base_rnn import RNN -from keras.layers.rnn.dropout_rnn_cell_mixin import DropoutRNNCellMixin -from keras.utils import tf_utils +from tf_keras import activations +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine import base_layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.rnn import gru_lstm_utils +from tf_keras.layers.rnn import rnn_utils +from tf_keras.layers.rnn.base_rnn import RNN +from tf_keras.layers.rnn.dropout_rnn_cell_mixin import DropoutRNNCellMixin +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -46,7 +46,7 @@ class GRUCell(DropoutRNNCellMixin, base_layer.BaseRandomLayer): """Cell class for the GRU layer. - See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) + See [the TF-Keras RNN API guide](https://www.tensorflow.org/guide/tf_keras/rnn) for details about the usage of RNN API. This class processes one step within the whole time sequence input, whereas @@ -395,7 +395,7 @@ def get_initial_state(self, inputs=None, batch_size=None, dtype=None): class GRU(DropoutRNNCellMixin, RNN, base_layer.BaseRandomLayer): """Gated Recurrent Unit - Cho et al. 2014. - See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) + See [the TF-Keras RNN API guide](https://www.tensorflow.org/guide/tf_keras/rnn) for details about the usage of RNN API. Based on available runtime hardware and constraints, this layer @@ -967,7 +967,7 @@ def standard_gru( input_bias, recurrent_bias = tf.unstack(bias) def step(cell_inputs, cell_states): - """Step function that will be used by Keras RNN backend.""" + """Step function that will be used by TF-Keras RNN backend.""" h_tm1 = cell_states[0] # inputs projected by all gate matrices at once diff --git a/keras/layers/rnn/gru_lstm_test.py b/tf_keras/layers/rnn/gru_lstm_test.py similarity index 97% rename from keras/layers/rnn/gru_lstm_test.py rename to tf_keras/layers/rnn/gru_lstm_test.py index 0c09541e6..05662220e 100644 --- a/keras/layers/rnn/gru_lstm_test.py +++ b/tf_keras/layers/rnn/gru_lstm_test.py @@ -23,11 +23,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.rnn import gru -from keras.layers.rnn import lstm -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.layers.rnn import gru +from tf_keras.layers.rnn import lstm +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/rnn/gru_lstm_utils.py b/tf_keras/layers/rnn/gru_lstm_utils.py similarity index 97% rename from keras/layers/rnn/gru_lstm_utils.py rename to tf_keras/layers/rnn/gru_lstm_utils.py index d0f320813..3799cc452 100644 --- a/keras/layers/rnn/gru_lstm_utils.py +++ b/tf_keras/layers/rnn/gru_lstm_utils.py @@ -73,13 +73,13 @@ def __init__(self, time_major, go_backwards, layer_name): + str(uuid.uuid4()), } if self.layer_name == "lstm": - from keras.layers.rnn import ( + from tf_keras.layers.rnn import ( lstm, ) layer_func = lstm.lstm_with_backend_selection else: - from keras.layers.rnn import ( + from tf_keras.layers.rnn import ( gru, ) @@ -102,11 +102,11 @@ def __deepcopy__(self, memo): def canonical_to_params(weights, biases, shape, transpose_weights=False): """Utility function convert variable to cuDNN compatible parameter. - Note that Keras weights for kernels are different from the cuDNN format. + Note that TF-Keras weights for kernels are different from the cuDNN format. Eg.: ``` - Keras cuDNN + TF-Keras cuDNN [[0, 1, 2], <---> [[0, 2, 4], [3, 4, 5]] [1, 3, 5]] ``` diff --git a/keras/layers/rnn/gru_test.py b/tf_keras/layers/rnn/gru_test.py similarity index 99% rename from keras/layers/rnn/gru_test.py rename to tf_keras/layers/rnn/gru_test.py index 241ad2c31..701bc5c05 100644 --- a/keras/layers/rnn/gru_test.py +++ b/tf_keras/layers/rnn/gru_test.py @@ -23,11 +23,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.rnn import gru_lstm_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import np_utils +import tf_keras as keras +from tf_keras.layers.rnn import gru_lstm_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import np_utils # isort: off from tensorflow.core.protobuf import rewriter_config_pb2 diff --git a/keras/layers/rnn/gru_v1.py b/tf_keras/layers/rnn/gru_v1.py similarity index 98% rename from keras/layers/rnn/gru_v1.py rename to tf_keras/layers/rnn/gru_v1.py index f6b458c6f..1bd18e1b8 100644 --- a/keras/layers/rnn/gru_v1.py +++ b/tf_keras/layers/rnn/gru_v1.py @@ -15,14 +15,14 @@ """Gated Recurrent Unit V1 layer.""" -from keras import activations -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine.input_spec import InputSpec -from keras.layers.rnn import gru -from keras.layers.rnn import rnn_utils -from keras.layers.rnn.base_rnn import RNN +from tf_keras import activations +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.rnn import gru +from tf_keras.layers.rnn import rnn_utils +from tf_keras.layers.rnn.base_rnn import RNN # isort: off from tensorflow.python.platform import tf_logging as logging diff --git a/keras/layers/rnn/gru_v1_test.py b/tf_keras/layers/rnn/gru_v1_test.py similarity index 96% rename from keras/layers/rnn/gru_v1_test.py rename to tf_keras/layers/rnn/gru_v1_test.py index 84f6e375f..959bf3b36 100644 --- a/keras/layers/rnn/gru_v1_test.py +++ b/tf_keras/layers/rnn/gru_v1_test.py @@ -20,12 +20,12 @@ from absl.testing import parameterized from tensorflow.core.protobuf import rewriter_config_pb2 -import keras -from keras.layers.rnn import gru -from keras.layers.rnn import gru_v1 -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import np_utils +import tf_keras as keras +from tf_keras.layers.rnn import gru +from tf_keras.layers.rnn import gru_v1 +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import np_utils # Global config for grappler setting that is used for graph mode test. _rewrites = rewriter_config_pb2.RewriterConfig() diff --git a/keras/layers/rnn/legacy_cell_wrappers.py b/tf_keras/layers/rnn/legacy_cell_wrappers.py similarity index 98% rename from keras/layers/rnn/legacy_cell_wrappers.py rename to tf_keras/layers/rnn/legacy_cell_wrappers.py index ebdbd399c..7236e318d 100644 --- a/keras/layers/rnn/legacy_cell_wrappers.py +++ b/tf_keras/layers/rnn/legacy_cell_wrappers.py @@ -24,10 +24,10 @@ import tensorflow.compat.v2 as tf -from keras.layers.rnn.cell_wrappers import _enumerated_map_structure_up_to -from keras.layers.rnn.cell_wrappers import _parse_config_to_function -from keras.layers.rnn.cell_wrappers import _serialize_function_to_config -from keras.layers.rnn.legacy_cells import RNNCell +from tf_keras.layers.rnn.cell_wrappers import _enumerated_map_structure_up_to +from tf_keras.layers.rnn.cell_wrappers import _parse_config_to_function +from tf_keras.layers.rnn.cell_wrappers import _serialize_function_to_config +from tf_keras.layers.rnn.legacy_cells import RNNCell # isort: off from tensorflow.python.util.tf_export import keras_export @@ -656,7 +656,7 @@ def get_config(self): def _default_dropout_state_filter_visitor(substate): - from keras.layers.rnn.legacy_cells import ( + from tf_keras.layers.rnn.legacy_cells import ( LSTMStateTuple, ) diff --git a/keras/layers/rnn/legacy_cell_wrappers_test.py b/tf_keras/layers/rnn/legacy_cell_wrappers_test.py similarity index 90% rename from keras/layers/rnn/legacy_cell_wrappers_test.py rename to tf_keras/layers/rnn/legacy_cell_wrappers_test.py index f9bf3040e..78afb3dcd 100644 --- a/keras/layers/rnn/legacy_cell_wrappers_test.py +++ b/tf_keras/layers/rnn/legacy_cell_wrappers_test.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.layers.rnn import legacy_cell_wrappers -from keras.layers.rnn import legacy_cells -from keras.testing_infra import test_combinations +from tf_keras.layers.rnn import legacy_cell_wrappers +from tf_keras.layers.rnn import legacy_cells +from tf_keras.testing_infra import test_combinations @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/layers/rnn/legacy_cells.py b/tf_keras/layers/rnn/legacy_cells.py similarity index 98% rename from keras/layers/rnn/legacy_cells.py rename to tf_keras/layers/rnn/legacy_cells.py index ca2431cb6..14f7fcdf3 100644 --- a/keras/layers/rnn/legacy_cells.py +++ b/tf_keras/layers/rnn/legacy_cells.py @@ -31,13 +31,13 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import backend -from keras import initializers -from keras.engine import base_layer_utils -from keras.engine import input_spec -from keras.legacy_tf_layers import base as base_layer -from keras.utils import tf_utils +from tf_keras import activations +from tf_keras import backend +from tf_keras import initializers +from tf_keras.engine import base_layer_utils +from tf_keras.engine import input_spec +from tf_keras.legacy_tf_layers import base as base_layer +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -171,7 +171,7 @@ class RNNCell(base_layer.Layer): def __init__(self, trainable=True, name=None, dtype=None, **kwargs): super().__init__(trainable=trainable, name=name, dtype=dtype, **kwargs) # Attribute that indicates whether the cell is a TF RNN cell, due the - # slight difference between TF and Keras RNN cell. Notably the state is + # slight difference between TF and TF-Keras RNN cell. Notably the state is # not wrapped in a list for TF cell where they are single tensor state, # whereas keras cell will wrap the state into a list, and call() will # have to unwrap them. @@ -391,7 +391,7 @@ class BasicRNNCell(LayerRNNCell): Args: num_units: int, The number of units in the RNN cell. activation: Nonlinearity to use. Default: `tanh`. It could also be string - that is within Keras activation function names. + that is within TF-Keras activation function names. reuse: (optional) Python boolean describing whether to reuse variables in an existing scope. If not `True`, and the existing scope already has the given variables, an error is raised. @@ -711,7 +711,7 @@ def __init__( the `c_state` and `m_state`. If False, they are concatenated along the column axis. The latter behavior will soon be deprecated. activation: Activation function of the inner states. Default: `tanh`. - It could also be string that is within Keras activation function + It could also be string that is within TF-Keras activation function names. reuse: (optional) Python boolean describing whether to reuse variables in an existing scope. If not `True`, and the existing scope already @@ -929,7 +929,7 @@ def __init__( the `c_state` and `m_state`. If False, they are concatenated along the column axis. This latter behavior will soon be deprecated. activation: Activation function of the inner states. Default: `tanh`. - It could also be string that is within Keras activation function + It could also be string that is within TF-Keras activation function names. reuse: (optional) Python boolean describing whether to reuse variables in an existing scope. If not `True`, and the existing scope already diff --git a/keras/layers/rnn/lstm.py b/tf_keras/layers/rnn/lstm.py similarity index 98% rename from keras/layers/rnn/lstm.py rename to tf_keras/layers/rnn/lstm.py index 47ae51f7e..d29deb81f 100644 --- a/keras/layers/rnn/lstm.py +++ b/tf_keras/layers/rnn/lstm.py @@ -19,18 +19,18 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine import base_layer -from keras.engine.input_spec import InputSpec -from keras.layers.rnn import gru_lstm_utils -from keras.layers.rnn import rnn_utils -from keras.layers.rnn.base_rnn import RNN -from keras.layers.rnn.dropout_rnn_cell_mixin import DropoutRNNCellMixin -from keras.utils import tf_utils +from tf_keras import activations +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine import base_layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.rnn import gru_lstm_utils +from tf_keras.layers.rnn import rnn_utils +from tf_keras.layers.rnn.base_rnn import RNN +from tf_keras.layers.rnn.dropout_rnn_cell_mixin import DropoutRNNCellMixin +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -46,7 +46,7 @@ class LSTMCell(DropoutRNNCellMixin, base_layer.BaseRandomLayer): """Cell class for the LSTM layer. - See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) + See [the TF-Keras RNN API guide](https://www.tensorflow.org/guide/tf_keras/rnn) for details about the usage of RNN API. This class processes one step within the whole time sequence input, whereas @@ -383,7 +383,7 @@ def get_initial_state(self, inputs=None, batch_size=None, dtype=None): class LSTM(DropoutRNNCellMixin, RNN, base_layer.BaseRandomLayer): """Long Short-Term Memory layer - Hochreiter 1997. - See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) + See [the TF-Keras RNN API guide](https://www.tensorflow.org/guide/tf_keras/rnn) for details about the usage of RNN API. Based on available runtime hardware and constraints, this layer @@ -960,7 +960,7 @@ def standard_lstm( timesteps = input_shape[0] if time_major else input_shape[1] def step(cell_inputs, cell_states): - """Step function that will be used by Keras RNN backend.""" + """Step function that will be used by TF-Keras RNN backend.""" h_tm1 = cell_states[0] # previous memory state c_tm1 = cell_states[1] # previous carry state diff --git a/keras/layers/rnn/lstm_test.py b/tf_keras/layers/rnn/lstm_test.py similarity index 99% rename from keras/layers/rnn/lstm_test.py rename to tf_keras/layers/rnn/lstm_test.py index e3e77ddda..b0930b688 100644 --- a/keras/layers/rnn/lstm_test.py +++ b/tf_keras/layers/rnn/lstm_test.py @@ -23,11 +23,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.rnn import gru_lstm_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import np_utils +import tf_keras as keras +from tf_keras.layers.rnn import gru_lstm_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import np_utils # isort: off from tensorflow.core.protobuf import rewriter_config_pb2 @@ -143,7 +143,7 @@ def test_specify_initial_state_keras_tensor(self): units = 3 num_samples = 2 - # Test with Keras tensor + # Test with TF-Keras tensor inputs = keras.Input((timesteps, embedding_dim)) initial_state = [keras.Input((units,)) for _ in range(num_states)] layer = keras.layers.LSTM(units) @@ -320,7 +320,7 @@ def test_initial_states_as_other_inputs(self): num_states = 2 layer_class = keras.layers.LSTM - # Test with Keras tensor + # Test with TF-Keras tensor main_inputs = keras.Input((timesteps, embedding_dim)) initial_state = [keras.Input((units,)) for _ in range(num_states)] inputs = [main_inputs] + initial_state @@ -1124,7 +1124,7 @@ def test_specify_initial_state_keras_tensor(self): units = 3 num_samples = 2 - # Test with Keras tensor + # Test with TF-Keras tensor inputs = keras.Input((timesteps, embedding_dim)) initial_state = [keras.Input((units,)) for _ in range(num_states)] layer = keras.layers.LSTM(units) @@ -1290,7 +1290,7 @@ def test_initial_states_as_other_inputs(self): num_states = 2 layer_class = keras.layers.LSTM - # Test with Keras tensor + # Test with TF-Keras tensor main_inputs = keras.Input((timesteps, embedding_dim)) initial_state = [keras.Input((units,)) for _ in range(num_states)] inputs = [main_inputs] + initial_state diff --git a/keras/layers/rnn/lstm_v1.py b/tf_keras/layers/rnn/lstm_v1.py similarity index 98% rename from keras/layers/rnn/lstm_v1.py rename to tf_keras/layers/rnn/lstm_v1.py index 78d4c700c..e85aa34c9 100644 --- a/keras/layers/rnn/lstm_v1.py +++ b/tf_keras/layers/rnn/lstm_v1.py @@ -15,14 +15,14 @@ """Long Short-Term Memory V1 layer.""" -from keras import activations -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine.input_spec import InputSpec -from keras.layers.rnn import lstm -from keras.layers.rnn import rnn_utils -from keras.layers.rnn.base_rnn import RNN +from tf_keras import activations +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.rnn import lstm +from tf_keras.layers.rnn import rnn_utils +from tf_keras.layers.rnn.base_rnn import RNN # isort: off from tensorflow.python.platform import tf_logging as logging diff --git a/keras/layers/rnn/lstm_v1_test.py b/tf_keras/layers/rnn/lstm_v1_test.py similarity index 98% rename from keras/layers/rnn/lstm_v1_test.py rename to tf_keras/layers/rnn/lstm_v1_test.py index f1d539985..0233a0c8f 100644 --- a/keras/layers/rnn/lstm_v1_test.py +++ b/tf_keras/layers/rnn/lstm_v1_test.py @@ -21,12 +21,12 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.rnn import lstm -from keras.layers.rnn import lstm_v1 -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import np_utils +import tf_keras as keras +from tf_keras.layers.rnn import lstm +from tf_keras.layers.rnn import lstm_v1 +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import np_utils # isort: off from tensorflow.core.protobuf import rewriter_config_pb2 diff --git a/keras/layers/rnn/rnn_utils.py b/tf_keras/layers/rnn/rnn_utils.py similarity index 99% rename from keras/layers/rnn/rnn_utils.py rename to tf_keras/layers/rnn/rnn_utils.py index c11bb3762..0690270c4 100644 --- a/keras/layers/rnn/rnn_utils.py +++ b/tf_keras/layers/rnn/rnn_utils.py @@ -17,7 +17,7 @@ import tensorflow.compat.v2 as tf -from keras.utils import control_flow_util +from tf_keras.utils import control_flow_util # isort: off from tensorflow.python.platform import tf_logging as logging diff --git a/keras/layers/rnn/simple_rnn.py b/tf_keras/layers/rnn/simple_rnn.py similarity index 96% rename from keras/layers/rnn/simple_rnn.py rename to tf_keras/layers/rnn/simple_rnn.py index 97a2e94d7..bd0fbdf7f 100644 --- a/keras/layers/rnn/simple_rnn.py +++ b/tf_keras/layers/rnn/simple_rnn.py @@ -17,17 +17,17 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import backend -from keras import constraints -from keras import initializers -from keras import regularizers -from keras.engine import base_layer -from keras.engine.input_spec import InputSpec -from keras.layers.rnn import rnn_utils -from keras.layers.rnn.base_rnn import RNN -from keras.layers.rnn.dropout_rnn_cell_mixin import DropoutRNNCellMixin -from keras.utils import tf_utils +from tf_keras import activations +from tf_keras import backend +from tf_keras import constraints +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine import base_layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.rnn import rnn_utils +from tf_keras.layers.rnn.base_rnn import RNN +from tf_keras.layers.rnn.dropout_rnn_cell_mixin import DropoutRNNCellMixin +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -38,7 +38,7 @@ class SimpleRNNCell(DropoutRNNCellMixin, base_layer.BaseRandomLayer): """Cell class for SimpleRNN. - See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) + See [the TF-Keras RNN API guide](https://www.tensorflow.org/guide/tf_keras/rnn) for details about the usage of RNN API. This class processes one step within the whole time sequence input, whereas @@ -254,7 +254,7 @@ def get_config(self): class SimpleRNN(RNN): """Fully-connected RNN where the output is to be fed back to input. - See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) + See [the TF-Keras RNN API guide](https://www.tensorflow.org/guide/tf_keras/rnn) for details about the usage of RNN API. Args: diff --git a/keras/layers/rnn/simple_rnn_test.py b/tf_keras/layers/rnn/simple_rnn_test.py similarity index 98% rename from keras/layers/rnn/simple_rnn_test.py rename to tf_keras/layers/rnn/simple_rnn_test.py index 9cd1a2766..484770ae1 100644 --- a/keras/layers/rnn/simple_rnn_test.py +++ b/tf_keras/layers/rnn/simple_rnn_test.py @@ -20,9 +20,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.generate(test_combinations.keras_mode_combinations()) diff --git a/keras/layers/rnn/stacked_rnn_cells.py b/tf_keras/layers/rnn/stacked_rnn_cells.py similarity index 96% rename from keras/layers/rnn/stacked_rnn_cells.py rename to tf_keras/layers/rnn/stacked_rnn_cells.py index 46bb3091f..c824dbc55 100644 --- a/keras/layers/rnn/stacked_rnn_cells.py +++ b/tf_keras/layers/rnn/stacked_rnn_cells.py @@ -19,12 +19,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer -from keras.layers.rnn import rnn_utils -from keras.saving import serialization_lib -from keras.utils import generic_utils -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine import base_layer +from tf_keras.layers.rnn import rnn_utils +from tf_keras.saving import serialization_lib +from tf_keras.utils import generic_utils +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -207,7 +207,7 @@ def get_config(self): @classmethod def from_config(cls, config, custom_objects=None): - from keras.layers import deserialize as deserialize_layer + from tf_keras.layers import deserialize as deserialize_layer cells = [] for cell_config in config.pop("cells"): diff --git a/keras/layers/rnn/time_distributed.py b/tf_keras/layers/rnn/time_distributed.py similarity index 98% rename from keras/layers/rnn/time_distributed.py rename to tf_keras/layers/rnn/time_distributed.py index 27f282363..b807ccd12 100644 --- a/keras/layers/rnn/time_distributed.py +++ b/tf_keras/layers/rnn/time_distributed.py @@ -17,13 +17,13 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine.base_layer import Layer -from keras.engine.input_spec import InputSpec -from keras.layers.rnn.base_wrapper import Wrapper -from keras.utils import generic_utils -from keras.utils import layer_utils -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_spec import InputSpec +from tf_keras.layers.rnn.base_wrapper import Wrapper +from tf_keras.utils import generic_utils +from tf_keras.utils import layer_utils +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/layers/rnn/time_distributed_test.py b/tf_keras/layers/rnn/time_distributed_test.py similarity index 99% rename from keras/layers/rnn/time_distributed_test.py rename to tf_keras/layers/rnn/time_distributed_test.py index 432fa3ad2..15563ab57 100644 --- a/keras/layers/rnn/time_distributed_test.py +++ b/tf_keras/layers/rnn/time_distributed_test.py @@ -19,9 +19,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.checkpoint import ( diff --git a/keras/layers/serialization.py b/tf_keras/layers/serialization.py similarity index 79% rename from keras/layers/serialization.py rename to tf_keras/layers/serialization.py index e35761b5b..d8a585043 100644 --- a/keras/layers/serialization.py +++ b/tf_keras/layers/serialization.py @@ -18,44 +18,44 @@ import tensorflow.compat.v2 as tf -from keras.engine import base_layer -from keras.engine import input_layer -from keras.engine import input_spec -from keras.layers import activation -from keras.layers import attention -from keras.layers import convolutional -from keras.layers import core -from keras.layers import locally_connected -from keras.layers import merging -from keras.layers import pooling -from keras.layers import regularization -from keras.layers import reshaping -from keras.layers import rnn -from keras.layers.normalization import batch_normalization -from keras.layers.normalization import batch_normalization_v1 -from keras.layers.normalization import group_normalization -from keras.layers.normalization import layer_normalization -from keras.layers.normalization import unit_normalization -from keras.layers.preprocessing import category_encoding -from keras.layers.preprocessing import discretization -from keras.layers.preprocessing import hashed_crossing -from keras.layers.preprocessing import hashing -from keras.layers.preprocessing import image_preprocessing -from keras.layers.preprocessing import integer_lookup -from keras.layers.preprocessing import ( +from tf_keras.engine import base_layer +from tf_keras.engine import input_layer +from tf_keras.engine import input_spec +from tf_keras.layers import activation +from tf_keras.layers import attention +from tf_keras.layers import convolutional +from tf_keras.layers import core +from tf_keras.layers import locally_connected +from tf_keras.layers import merging +from tf_keras.layers import pooling +from tf_keras.layers import regularization +from tf_keras.layers import reshaping +from tf_keras.layers import rnn +from tf_keras.layers.normalization import batch_normalization +from tf_keras.layers.normalization import batch_normalization_v1 +from tf_keras.layers.normalization import group_normalization +from tf_keras.layers.normalization import layer_normalization +from tf_keras.layers.normalization import unit_normalization +from tf_keras.layers.preprocessing import category_encoding +from tf_keras.layers.preprocessing import discretization +from tf_keras.layers.preprocessing import hashed_crossing +from tf_keras.layers.preprocessing import hashing +from tf_keras.layers.preprocessing import image_preprocessing +from tf_keras.layers.preprocessing import integer_lookup +from tf_keras.layers.preprocessing import ( normalization as preprocessing_normalization, ) -from keras.layers.preprocessing import string_lookup -from keras.layers.preprocessing import text_vectorization -from keras.layers.rnn import cell_wrappers -from keras.layers.rnn import gru -from keras.layers.rnn import lstm -from keras.metrics import base_metric -from keras.saving import serialization_lib -from keras.saving.legacy import serialization as legacy_serialization -from keras.saving.legacy.saved_model import json_utils -from keras.utils import generic_utils -from keras.utils import tf_inspect as inspect +from tf_keras.layers.preprocessing import string_lookup +from tf_keras.layers.preprocessing import text_vectorization +from tf_keras.layers.rnn import cell_wrappers +from tf_keras.layers.rnn import gru +from tf_keras.layers.rnn import lstm +from tf_keras.metrics import base_metric +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy import serialization as legacy_serialization +from tf_keras.saving.legacy.saved_model import json_utils +from tf_keras.utils import generic_utils +from tf_keras.utils import tf_inspect as inspect # isort: off from tensorflow.python.util.tf_export import keras_export @@ -144,14 +144,14 @@ def populate_deserializable_objects(): ] = batch_normalization.BatchNormalization # Prevent circular dependencies. - from keras import models - from keras.feature_column.sequence_feature_column import ( + from tf_keras import models + from tf_keras.feature_column.sequence_feature_column import ( SequenceFeatures, ) - from keras.premade_models.linear import ( + from tf_keras.premade_models.linear import ( LinearModel, ) - from keras.premade_models.wide_deep import ( + from tf_keras.premade_models.wide_deep import ( WideDeepModel, ) @@ -165,13 +165,13 @@ def populate_deserializable_objects(): LOCAL.ALL_OBJECTS["WideDeepModel"] = WideDeepModel if tf.__internal__.tf2.enabled(): - from keras.feature_column.dense_features_v2 import ( + from tf_keras.feature_column.dense_features_v2 import ( DenseFeatures, ) LOCAL.ALL_OBJECTS["DenseFeatures"] = DenseFeatures else: - from keras.feature_column.dense_features import ( + from tf_keras.feature_column.dense_features import ( DenseFeatures, ) diff --git a/keras/layers/serialization_test.py b/tf_keras/layers/serialization_test.py similarity index 94% rename from keras/layers/serialization_test.py rename to tf_keras/layers/serialization_test.py index 688466be0..4dde25a4b 100644 --- a/keras/layers/serialization_test.py +++ b/tf_keras/layers/serialization_test.py @@ -17,15 +17,15 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.layers.normalization import batch_normalization as batchnorm_v2 -from keras.layers.normalization import batch_normalization_v1 as batchnorm_v1 -from keras.layers.rnn import gru -from keras.layers.rnn import gru_v1 -from keras.layers.rnn import lstm -from keras.layers.rnn import lstm_v1 -from keras.metrics import Mean -from keras.testing_infra import test_combinations +import tf_keras as keras +from tf_keras.layers.normalization import batch_normalization as batchnorm_v2 +from tf_keras.layers.normalization import batch_normalization_v1 as batchnorm_v1 +from tf_keras.layers.rnn import gru +from tf_keras.layers.rnn import gru_v1 +from tf_keras.layers.rnn import lstm +from tf_keras.layers.rnn import lstm_v1 +from tf_keras.metrics import Mean +from tf_keras.testing_infra import test_combinations class SerializableInt(int): diff --git a/keras/layers/subclassed_layers_test.py b/tf_keras/layers/subclassed_layers_test.py similarity index 91% rename from keras/layers/subclassed_layers_test.py rename to tf_keras/layers/subclassed_layers_test.py index de4ebeaca..4ed51cb7b 100644 --- a/keras/layers/subclassed_layers_test.py +++ b/tf_keras/layers/subclassed_layers_test.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras subclassed layers utilizing desired user syntax.""" +"""Tests for TF-Keras subclassed layers utilizing desired user syntax.""" import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import tf_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import tf_utils @test_combinations.run_all_keras_modes diff --git a/keras/layers/tensorflow_op_layer_test.py b/tf_keras/layers/tensorflow_op_layer_test.py similarity index 97% rename from keras/layers/tensorflow_op_layer_test.py rename to tf_keras/layers/tensorflow_op_layer_test.py index 6c0173c14..fad59c67b 100644 --- a/keras/layers/tensorflow_op_layer_test.py +++ b/tf_keras/layers/tensorflow_op_layer_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Test for allowing TF ops to work with Keras Functional API.""" +"""Test for allowing TF ops to work with TF-Keras Functional API.""" import time @@ -20,12 +20,12 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.engine import keras_tensor -from keras.optimizers.legacy import adam -from keras.saving.legacy import model_config -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.engine import keras_tensor +from tf_keras.optimizers.legacy import adam +from tf_keras.saving.legacy import model_config +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils def _single_op_at_end(): @@ -120,7 +120,7 @@ def _shape_op_slice_and_range_known_dim(): def _int32_manipulation_too_big_for_shape(): - # This test verifies that the Keras Functional API + # This test verifies that the TF-Keras Functional API # won't crash when manipulating int32 tensors that are too large # to represent shapes. inputs = keras.Input(batch_size=2, shape=(10,)) @@ -141,9 +141,9 @@ def _int32_manipulation_too_big_for_shape(): def _int32_manipulation_at_max_shape_dims_limit(): - # This test verifies that the Keras Functional API + # This test verifies that the TF-Keras Functional API # won't crash when manipulating int32 tensors that are at the limit - # of the max tensor size Keras can try inferring values for. + # of the max tensor size TF-Keras can try inferring values for. inputs = keras.Input(batch_size=2, shape=(10,)) batch_size = tf.shape(inputs)[0] num_features = int(keras_tensor._MAX_TENSOR_RANK / int(inputs.shape[0])) @@ -243,7 +243,7 @@ def build(self, input_shape): def call(self, inputs): inputs = inputs * self.bias - # Would throw an error if Keras History was created here. + # Would throw an error if TF-Keras History was created here. return self.layer(inputs) @@ -748,7 +748,7 @@ class InputInEagerTest(test_combinations.TestCase): """Tests ops on keras inputs in Eager runtime. Input returns graph/symbolic tensors in the Eager runtime (this - happens, for example, with tensors returned from Keras layers). These + happens, for example, with tensors returned from TF-Keras layers). These should be routed to the graph-style branch of these ops (b/134715641) """ diff --git a/keras/legacy_tf_layers/BUILD b/tf_keras/legacy_tf_layers/BUILD similarity index 79% rename from keras/legacy_tf_layers/BUILD rename to tf_keras/legacy_tf_layers/BUILD index 67a8950d6..20301049b 100644 --- a/keras/legacy_tf_layers/BUILD +++ b/tf_keras/legacy_tf_layers/BUILD @@ -4,14 +4,13 @@ # Placeholder: load unaliased py_library # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "tf_py_test") -load("@org_keras//keras:keras.bzl", "cuda_py_test") +load("@org_tensorflow//tensorflow:tensorflow.bzl", "cuda_py_test", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", "//learning/brain/contrib:__subpackages__", + "//tf_keras:friends", "//third_party/tensorflow:__subpackages__", ], licenses = ["notice"], @@ -42,9 +41,9 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer", - "//keras/mixed_precision:policy", + "//tf_keras:backend", + "//tf_keras/engine:base_layer", + "//tf_keras/mixed_precision:policy", ], ) @@ -55,7 +54,7 @@ py_library( deps = [ ":layers_base", "//:expect_tensorflow_installed", - "//keras/layers", + "//tf_keras/layers", ], ) @@ -66,7 +65,7 @@ py_library( deps = [ ":layers_base", "//:expect_tensorflow_installed", - "//keras/layers", + "//tf_keras/layers", ], ) @@ -77,7 +76,7 @@ py_library( deps = [ ":layers_base", "//:expect_tensorflow_installed", - "//keras/layers/normalization", + "//tf_keras/layers/normalization", ], ) @@ -88,7 +87,7 @@ py_library( deps = [ ":layers_base", "//:expect_tensorflow_installed", - "//keras/layers", + "//tf_keras/layers", ], ) @@ -102,9 +101,9 @@ tf_py_test( ":core", ":layers_base", "//:expect_tensorflow_installed", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/testing_infra:test_combinations", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -117,7 +116,7 @@ tf_py_test( deps = [ ":core", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -172,9 +171,9 @@ tf_py_test( ":core", ":layers_base", "//:expect_tensorflow_installed", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/testing_infra:test_combinations", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -187,8 +186,8 @@ tf_py_test( deps = [ ":layers", "//:expect_tensorflow_installed", - "//keras/engine:base_layer", - "//keras/engine:input_spec", - "//keras/testing_infra:test_combinations", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:input_spec", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/tf_keras/legacy_tf_layers/__init__.py b/tf_keras/legacy_tf_layers/__init__.py new file mode 100644 index 000000000..9b82d9599 --- /dev/null +++ b/tf_keras/legacy_tf_layers/__init__.py @@ -0,0 +1,3 @@ +"""Init file.""" + +from tf_keras.legacy_tf_layers import migration_utils diff --git a/keras/legacy_tf_layers/base.py b/tf_keras/legacy_tf_layers/base.py similarity index 97% rename from keras/legacy_tf_layers/base.py rename to tf_keras/legacy_tf_layers/base.py index fa2beea2f..0ae7f1874 100644 --- a/keras/legacy_tf_layers/base.py +++ b/tf_keras/legacy_tf_layers/base.py @@ -23,12 +23,12 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer_utils -from keras.engine import base_layer_v1 as base_layer -from keras.legacy_tf_layers import variable_scope_shim -from keras.mixed_precision import policy -from keras.utils import tf_contextlib +from tf_keras import backend +from tf_keras.engine import base_layer_utils +from tf_keras.engine import base_layer_v1 as base_layer +from tf_keras.legacy_tf_layers import variable_scope_shim +from tf_keras.mixed_precision import policy +from tf_keras.utils import tf_contextlib # isort: off from tensorflow.python.ops import variable_scope as vs @@ -49,11 +49,11 @@ def keras_style_scope(): disallowed, and reuse=True is disallowed. The purpose of this scope is to allow users of existing layers to - slowly transition to a Keras layers API without breaking existing + slowly transition to a TF-Keras layers API without breaking existing functionality. One example of this is when using TensorFlow's RNN classes with Keras - Models or Networks. Because Keras models do not properly set variable + Models or Networks. Because TF-Keras models do not properly set variable scopes, users of RNNs may either accidentally share scopes between two different models, or get errors about variables that already exist. @@ -119,7 +119,7 @@ def set_keras_style(): scope= argument is disallowed, and reuse=True is disallowed. The purpose of this function is to allow users of existing layers to - slowly transition to Keras layers API without breaking existing + slowly transition to TF-Keras layers API without breaking existing functionality. For more details, see the documentation for `keras_style_scope`. @@ -201,14 +201,14 @@ def __init__(self, trainable=True, name=None, dtype=None, **kwargs): if dtype is None: # Indicates to infer dtype from inputs. When the V2 dtype behavior - # is enabled, Keras layers default their dtype to floatx instead, so + # is enabled, TF-Keras layers default their dtype to floatx instead, so # we pass an "_infer" policy to keep the old V1 behavior. dtype = policy.Policy("_infer") if "autocast" not in kwargs: kwargs["autocast"] = False - # Mark that legacy layers should not be instrumented as Keras usage + # Mark that legacy layers should not be instrumented as TF-Keras usage self._disable_keras_instrumentation = True super().__init__(trainable=trainable, name=name, dtype=dtype, **kwargs) @@ -554,7 +554,7 @@ def __call__(self, inputs, *args, **kwargs): layers do), its default value will be set to the mask generated for `inputs` by the previous layer (if `input` did come from a layer that generated a corresponding mask, i.e. if it came from - a Keras layer with masking support. + a TF-Keras layer with masking support. Raises: ValueError: if the layer's `call` method returns None (an invalid diff --git a/keras/legacy_tf_layers/base_test.py b/tf_keras/legacy_tf_layers/base_test.py similarity index 98% rename from keras/legacy_tf_layers/base_test.py rename to tf_keras/legacy_tf_layers/base_test.py index e71403e8c..7bae46cd4 100644 --- a/keras/legacy_tf_layers/base_test.py +++ b/tf_keras/legacy_tf_layers/base_test.py @@ -24,12 +24,12 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import backend -from keras.engine import base_layer as keras_base_layer -from keras.engine import input_spec -from keras.legacy_tf_layers import base as base_tf_layers -from keras.legacy_tf_layers import core as core_tf_layers -from keras.testing_infra import test_combinations +from tf_keras import backend +from tf_keras.engine import base_layer as keras_base_layer +from tf_keras.engine import input_spec +from tf_keras.legacy_tf_layers import base as base_tf_layers +from tf_keras.legacy_tf_layers import core as core_tf_layers +from tf_keras.testing_infra import test_combinations class BaseLayerTest(tf.test.TestCase, parameterized.TestCase): @@ -49,7 +49,7 @@ def testLayerProperties(self): layer = base_tf_layers.Layer(name="my_layer", trainable=False) self.assertEqual(layer.trainable, False) - # Assert that the layer was not instrumented as a Keras layer + # Assert that the layer was not instrumented as a TF-Keras layer self.assertFalse(layer._instrumented_keras_api) # Assert this was instrumented as a legacy layer @@ -87,7 +87,7 @@ def testKerasStyleAddWeight(self): with base_tf_layers.keras_style_scope(): layer = base_tf_layers.Layer(name="my_layer") - # Assert that the layer was not instrumented as a Keras layer + # Assert that the layer was not instrumented as a TF-Keras layer self.assertFalse(layer._instrumented_keras_api) # Test basic variable creation. with backend.name_scope("bar"): diff --git a/keras/legacy_tf_layers/convolutional.py b/tf_keras/legacy_tf_layers/convolutional.py similarity index 98% rename from keras/legacy_tf_layers/convolutional.py rename to tf_keras/legacy_tf_layers/convolutional.py index 735553e45..158a8b40e 100644 --- a/keras/legacy_tf_layers/convolutional.py +++ b/tf_keras/legacy_tf_layers/convolutional.py @@ -22,8 +22,8 @@ import tensorflow.compat.v2 as tf -from keras import layers as keras_layers -from keras.legacy_tf_layers import base +from tf_keras import layers as keras_layers +from tf_keras.legacy_tf_layers import base # isort: off from tensorflow.python.util.tf_export import keras_export @@ -89,7 +89,7 @@ class Conv1D(keras_layers.Conv1D, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Conv1D`. @@ -245,7 +245,7 @@ def conv1d( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Conv1D`. @@ -263,7 +263,7 @@ def conv1d( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) @@ -370,7 +370,7 @@ class Conv2D(keras_layers.Conv2D, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Conv2D`. @@ -533,7 +533,7 @@ def conv2d( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Conv2D`. @@ -551,7 +551,7 @@ def conv2d( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) @@ -659,7 +659,7 @@ class Conv3D(keras_layers.Conv3D, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Conv3D`. @@ -823,7 +823,7 @@ def conv3d( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Conv3D`. @@ -841,7 +841,7 @@ def conv3d( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) @@ -953,7 +953,7 @@ class SeparableConv1D(keras_layers.SeparableConv1D, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.SeparableConv1D`. @@ -1105,7 +1105,7 @@ class SeparableConv2D(keras_layers.SeparableConv2D, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.SeparableConv2D`. @@ -1285,7 +1285,7 @@ def separable_conv1d( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.SeparableConv1D`. @@ -1304,7 +1304,7 @@ def separable_conv1d( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) @@ -1456,7 +1456,7 @@ def separable_conv2d( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.SeparableConv2D`. @@ -1475,7 +1475,7 @@ def separable_conv2d( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) @@ -1576,7 +1576,7 @@ class Conv2DTranspose(keras_layers.Conv2DTranspose, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Conv2DTranspose`. @@ -1727,7 +1727,7 @@ def conv2d_transpose( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Conv2DTranspose`. @@ -1746,7 +1746,7 @@ def conv2d_transpose( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) @@ -1838,7 +1838,7 @@ class Conv3DTranspose(keras_layers.Conv3DTranspose, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Conv3DTranspose`. @@ -1983,7 +1983,7 @@ def conv3d_transpose( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Conv3DTranspose`. @@ -2002,7 +2002,7 @@ def conv3d_transpose( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) diff --git a/keras/legacy_tf_layers/convolutional_test.py b/tf_keras/legacy_tf_layers/convolutional_test.py similarity index 99% rename from keras/legacy_tf_layers/convolutional_test.py rename to tf_keras/legacy_tf_layers/convolutional_test.py index 296aef07d..b0984b21a 100644 --- a/keras/legacy_tf_layers/convolutional_test.py +++ b/tf_keras/legacy_tf_layers/convolutional_test.py @@ -21,7 +21,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.legacy_tf_layers import convolutional as conv_layers +from tf_keras.legacy_tf_layers import convolutional as conv_layers class ConvTest(tf.test.TestCase): diff --git a/keras/legacy_tf_layers/core.py b/tf_keras/legacy_tf_layers/core.py similarity index 96% rename from keras/legacy_tf_layers/core.py rename to tf_keras/legacy_tf_layers/core.py index b4111dc91..14d26ede9 100644 --- a/keras/legacy_tf_layers/core.py +++ b/tf_keras/legacy_tf_layers/core.py @@ -25,8 +25,8 @@ import tensorflow.compat.v2 as tf -from keras import layers as keras_layers -from keras.legacy_tf_layers import base +from tf_keras import layers as keras_layers +from tf_keras.legacy_tf_layers import base # isort: off from tensorflow.python.util.tf_export import keras_export @@ -93,7 +93,7 @@ class Dense(keras_layers.Dense, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Dense`. @@ -218,7 +218,7 @@ def dense( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Dense`. @@ -236,7 +236,7 @@ def dense( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28,)) @@ -302,7 +302,7 @@ class Dropout(keras_layers.Dropout, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Dropout`. @@ -385,7 +385,7 @@ def dropout( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Dropout`. @@ -403,7 +403,7 @@ def dropout( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) @@ -452,7 +452,7 @@ class Flatten(keras_layers.Flatten, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Flatten`. @@ -513,7 +513,7 @@ def flatten(inputs, name=None, data_format="channels_last"): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.Flatten`. @@ -531,7 +531,7 @@ def flatten(inputs, name=None, data_format="channels_last"): After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) diff --git a/keras/legacy_tf_layers/core_test.py b/tf_keras/legacy_tf_layers/core_test.py similarity index 99% rename from keras/legacy_tf_layers/core_test.py rename to tf_keras/legacy_tf_layers/core_test.py index 558aa823d..93dbf964f 100644 --- a/keras/legacy_tf_layers/core_test.py +++ b/tf_keras/legacy_tf_layers/core_test.py @@ -25,8 +25,8 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.legacy_tf_layers import core as core_layers -from keras.testing_infra import test_combinations +from tf_keras.legacy_tf_layers import core as core_layers +from tf_keras.testing_infra import test_combinations # isort: off from tensorflow.python.framework import ( diff --git a/keras/legacy_tf_layers/migration_utils.py b/tf_keras/legacy_tf_layers/migration_utils.py similarity index 100% rename from keras/legacy_tf_layers/migration_utils.py rename to tf_keras/legacy_tf_layers/migration_utils.py diff --git a/keras/legacy_tf_layers/migration_utils_test.py b/tf_keras/legacy_tf_layers/migration_utils_test.py similarity index 99% rename from keras/legacy_tf_layers/migration_utils_test.py rename to tf_keras/legacy_tf_layers/migration_utils_test.py index 3d024ceb2..27eca9f02 100644 --- a/keras/legacy_tf_layers/migration_utils_test.py +++ b/tf_keras/legacy_tf_layers/migration_utils_test.py @@ -2,7 +2,7 @@ import tensorflow as tf -from keras.legacy_tf_layers import migration_utils +from tf_keras.legacy_tf_layers import migration_utils class DeterministicRandomTestToolTest(tf.test.TestCase): diff --git a/keras/legacy_tf_layers/normalization.py b/tf_keras/legacy_tf_layers/normalization.py similarity index 98% rename from keras/legacy_tf_layers/normalization.py rename to tf_keras/legacy_tf_layers/normalization.py index c11f6457b..801c41d81 100644 --- a/keras/legacy_tf_layers/normalization.py +++ b/tf_keras/legacy_tf_layers/normalization.py @@ -22,8 +22,8 @@ import tensorflow.compat.v2 as tf -from keras.layers.normalization import batch_normalization_v1 -from keras.legacy_tf_layers import base +from tf_keras.layers.normalization import batch_normalization_v1 +from tf_keras.legacy_tf_layers import base # isort: off from tensorflow.python.util.tf_export import keras_export @@ -35,7 +35,7 @@ class BatchNormalization(batch_normalization_v1.BatchNormalization, base.Layer): """Batch Normalization layer from (Ioffe et al., 2015). - Keras APIs handle BatchNormalization updates to the moving_mean and + TF-Keras APIs handle BatchNormalization updates to the moving_mean and moving_variance as part of their `fit()` and `evaluate()` loops. However, if a custom training loop is used with an instance of `Model`, these updates need to be explicitly included. Here's a simple example of how it can be @@ -133,7 +133,7 @@ class BatchNormalization(batch_normalization_v1.BatchNormalization, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.BatchNormalization`. @@ -380,7 +380,7 @@ def batch_normalization( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.BatchNormalization`. @@ -403,7 +403,7 @@ def batch_normalization( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input(shape=(28, 28, 1),) diff --git a/keras/legacy_tf_layers/normalization_test.py b/tf_keras/legacy_tf_layers/normalization_test.py similarity index 99% rename from keras/legacy_tf_layers/normalization_test.py rename to tf_keras/legacy_tf_layers/normalization_test.py index 097b20b85..d9422c6a7 100644 --- a/keras/legacy_tf_layers/normalization_test.py +++ b/tf_keras/legacy_tf_layers/normalization_test.py @@ -23,8 +23,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.legacy_tf_layers import convolutional as conv_layers -from keras.legacy_tf_layers import normalization as normalization_layers +from tf_keras.legacy_tf_layers import convolutional as conv_layers +from tf_keras.legacy_tf_layers import normalization as normalization_layers # isort: off from tensorflow.core.protobuf import saver_pb2 diff --git a/keras/legacy_tf_layers/pooling.py b/tf_keras/legacy_tf_layers/pooling.py similarity index 95% rename from keras/legacy_tf_layers/pooling.py rename to tf_keras/legacy_tf_layers/pooling.py index 71695d771..fd20541f3 100644 --- a/keras/legacy_tf_layers/pooling.py +++ b/tf_keras/legacy_tf_layers/pooling.py @@ -20,8 +20,8 @@ import warnings -from keras import layers as keras_layers -from keras.legacy_tf_layers import base +from tf_keras import layers as keras_layers +from tf_keras.legacy_tf_layers import base # isort: off from tensorflow.python.util.tf_export import keras_export @@ -53,7 +53,7 @@ class AveragePooling1D(keras_layers.AveragePooling1D, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.AveragePooling1D`. @@ -138,7 +138,7 @@ def average_pooling1d( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.AveragePooling1D`. @@ -157,7 +157,7 @@ def average_pooling1d( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) @@ -208,7 +208,7 @@ class MaxPooling1D(keras_layers.MaxPooling1D, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.MaxPooling1D`. @@ -293,7 +293,7 @@ def max_pooling1d( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.MaxPooling1D`. @@ -312,7 +312,7 @@ def max_pooling1d( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) @@ -367,7 +367,7 @@ class AveragePooling2D(keras_layers.AveragePooling2D, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.AveragePooling2D`. @@ -456,7 +456,7 @@ def average_pooling2d( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.AveragePooling2D`. @@ -475,7 +475,7 @@ def average_pooling2d( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) @@ -530,7 +530,7 @@ class MaxPooling2D(keras_layers.MaxPooling2D, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.MaxPooling2D`. @@ -619,7 +619,7 @@ def max_pooling2d( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.MaxPooling2D`. @@ -638,7 +638,7 @@ def max_pooling2d( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) @@ -695,7 +695,7 @@ class AveragePooling3D(keras_layers.AveragePooling3D, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.AveragePooling3D`. @@ -786,7 +786,7 @@ def average_pooling3d( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.AveragePooling3D`. @@ -805,7 +805,7 @@ def average_pooling3d( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) @@ -862,7 +862,7 @@ class MaxPooling3D(keras_layers.MaxPooling3D, base.Layer): Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.MaxPooling3D`. @@ -952,7 +952,7 @@ def max_pooling3d( Please refer to [tf.layers model mapping section of the migration guide] (https://www.tensorflow.org/guide/migrate/model_mapping) - to learn how to use your TensorFlow v1 model in TF2 with Keras. + to learn how to use your TensorFlow v1 model in TF2 with TF-Keras. The corresponding TensorFlow v2 layer is `tf.keras.layers.MaxPooling3D`. @@ -971,7 +971,7 @@ def max_pooling3d( After: To migrate code using TF1 functional layers use the [Keras Functional API] - (https://www.tensorflow.org/guide/keras/functional): + (https://www.tensorflow.org/guide/tf_keras/functional): ```python x = tf.keras.Input((28, 28, 1)) diff --git a/keras/legacy_tf_layers/pooling_test.py b/tf_keras/legacy_tf_layers/pooling_test.py similarity index 99% rename from keras/legacy_tf_layers/pooling_test.py rename to tf_keras/legacy_tf_layers/pooling_test.py index a60049897..7ad29737e 100644 --- a/keras/legacy_tf_layers/pooling_test.py +++ b/tf_keras/legacy_tf_layers/pooling_test.py @@ -20,7 +20,7 @@ import tensorflow.compat.v2 as tf -from keras.legacy_tf_layers import pooling as pooling_layers +from tf_keras.legacy_tf_layers import pooling as pooling_layers # isort: off from tensorflow.python.framework import ( diff --git a/keras/legacy_tf_layers/variable_scope_shim.py b/tf_keras/legacy_tf_layers/variable_scope_shim.py similarity index 96% rename from keras/legacy_tf_layers/variable_scope_shim.py rename to tf_keras/legacy_tf_layers/variable_scope_shim.py index 5eaf3f2fc..01579f817 100644 --- a/keras/legacy_tf_layers/variable_scope_shim.py +++ b/tf_keras/legacy_tf_layers/variable_scope_shim.py @@ -23,9 +23,9 @@ import tensorflow.compat.v2 as tf -from keras.engine import base_layer -from keras.utils import layer_utils -from keras.utils import tf_inspect +from tf_keras.engine import base_layer +from tf_keras.utils import layer_utils +from tf_keras.utils import tf_inspect # isort: off from tensorflow.python.ops import variable_scope as vs @@ -646,7 +646,7 @@ def track_tf1_style_variables(method): tracked by the layer under the standard `layer.losses` property. This tracking enables using large classes of TF1-style model-forward-pass - code inside of Keras layers or `tf.Modules` in TF2 with TF2 behaviors + code inside of TF-Keras layers or `tf.Modules` in TF2 with TF2 behaviors enabled. Example of capturing tf.compat.v1.layer-based modeling code as a Keras @@ -683,12 +683,12 @@ def call(self, inputs): layer.trainable_variables # Regularization losses will be captured in layer.losses after a call, - # just like any other Keras layer + # just like any other TF-Keras layer reg_losses = layer.losses ``` Example of capturing tf.compat.v1.get_variable-based modeling code as - a Keras layer: + a TF-Keras layer: ```python class WrappedDoubleDenseLayer(tf.keras.layers.Layer): @@ -740,7 +740,7 @@ def call(self, inputs): layer.trainable_variables # Regularization losses will be captured in layer.losses after a call, - # just like any other Keras layer + # just like any other TF-Keras layer reg_losses = layer.losses ``` @@ -750,16 +750,16 @@ def call(self, inputs): decorated method and the method belongs to a `tf.keras.Layer`/`tf.keras.Module`. Regularization losses are accessible in `layer.losses` after a call just like in a standard - Keras layer, and will be captured by any model that includes this layer. - Regularization losses attached to Keras layers/models set as attributes - of your layer will also get captured in the standard Keras regularization + TF-Keras layer, and will be captured by any model that includes this layer. + Regularization losses attached to TF-Keras layers/models set as attributes + of your layer will also get captured in the standard TF-Keras regularization loss tracking. (While Modules have no `losses` property, no-arg callables to compute the regularization losses may be tracked as dict values in a private `module._tf1_style_var_store._regularizers` property, but only for `tf.compat.v1.layers` and `get_variable` weights and not for any other - nested Keras layers/tf.Modules) + nested TF-Keras layers/tf.Modules) Variable scope / variable reuse: variable-scope based reuse in your decorated method will be respected, @@ -768,11 +768,11 @@ def call(self, inputs): Variable Names/Pre-trained checkpoint loading: Variable naming from get_variable and `compat.v1.layer` layers will match the TF1 names, so you should be able to re-use your old name-based - checkpoints. Variable naming for Keras layers/models or for variables + checkpoints. Variable naming for TF-Keras layers/models or for variables created by `tf.Variable` may change when going to eager execution. Training Arg if you decorate `layer.call`: - Keras will pass a `training` arg to this layer if `call` contains + TF-Keras will pass a `training` arg to this layer if `call` contains a `training` arg or a `**kwargs` varargs in its call signature, similarly to how keras passes `training` to other layers in TF2 that have similar signatures in their `call` implementations. @@ -792,7 +792,7 @@ def call(self, inputs): a function inside of a decorated method may break the variable scoping. * This decorator only adds implicit tracking for legacy tf1-style get_variable / compat.v1.layers usage. - If you would like to use nested Keras layers/models + If you would like to use nested TF-Keras layers/models inside the decorated method, you need to assign them as attributes of your layer so that Keras/Module's standard object-oriented weights (and loss tracking for layers) will kick in. @@ -852,10 +852,10 @@ class VariableScopeLayer(base_layer.Layer): """Wrapper Layer to capture `compat.v1.get_variable` and `compat.v1.layers`. This shim layer allows using large sets of TF1 model-forward-pass code as a - Keras layer that works in TF2 with TF2 behaviors enabled. It will capture + TF-Keras layer that works in TF2 with TF2 behaviors enabled. It will capture both weights and regularization losses of your forward-pass code. To use it, override this class and put your TF1 model's forward pass inside your - implementation for `forward_pass`. (Unlike standard custom Keras layers, + implementation for `forward_pass`. (Unlike standard custom TF-Keras layers, do not override `call`.) Below are some examples, and then more details on the functionality of this @@ -894,12 +894,12 @@ def forward_pass(self, inputs): layer.trainable_variables # Regularization losses will be captured in layer.losses after a call, - # just like any other Keras layer + # just like any other TF-Keras layer reg_losses = layer.losses ``` Example of capturing tf.compat.v1.get_variable-based modeling code as - a Keras layer: + a TF-Keras layer: ```python class WrappedDoubleDenseLayer(variable_scope_shim.VariableScopeLayer): @@ -950,7 +950,7 @@ def forward_pass(self, inputs): layer.trainable_variables # Regularization losses will be captured in layer.losses after a call, - # just like any other Keras layer + # just like any other TF-Keras layer reg_losses = layer.losses ``` @@ -958,10 +958,10 @@ def forward_pass(self, inputs): Any regularizers specified in the `get_variable` calls or `compat.v1.layer` creations will get captured by this wrapper layer. Regularization losses are accessible in `layer.losses` after a call just - like in a standard Keras layer, and will be captured by any model that + like in a standard TF-Keras layer, and will be captured by any model that includes this layer. Regularization losses attached to Keras layers/models set as attributes of your layer will also get captured in - the standard Keras regularization loss tracking. + the standard TF-Keras regularization loss tracking. Variable scope / variable reuse: variable-scope based reuse in the `forward_pass` will be respected, @@ -970,11 +970,11 @@ def forward_pass(self, inputs): Variable Names/Pre-trained checkpoint loading: Variable naming from get_variable and `compat.v1.layer` layers will match the TF1 names, so you should be able to re-use your old name-based - checkpoints. Variable naming for Keras layers/models or for variables + checkpoints. Variable naming for TF-Keras layers/models or for variables created by `tf.Variable` may change when going to eager execution. Training Arg in `forward_pass`: - Keras will pass a `training` arg to this layer if `forward_pass` contains + TF-Keras will pass a `training` arg to this layer if `forward_pass` contains a `training` arg or a `**kwargs` varargs in its call signature, similarly to how keras passes `training` to other layers in TF2 that have similar signatures in their `call` implementations. @@ -986,7 +986,7 @@ def forward_pass(self, inputs): Call signature of the forward pass: The semantics of the forward pass signature match the standard - Keras layer `call` signature, including how Keras decides when + TF-Keras layer `call` signature, including how TF-Keras decides when to pass in a `training` arg., and the semantics applied to the first positional arg in the call signature. @@ -998,7 +998,7 @@ def forward_pass(self, inputs): * Avoid Nesting variable creation in tf.function inside of `forward_pass` While the layer may safely be used from inside a `tf.function`, using a function inside of `forward_pass` will break the variable scoping. - * If you would like to nest Keras layers/models or other + * If you would like to nest TF-Keras layers/models or other `VariableScopeLayer`s directly in `forward_pass`, you need to assign them as attributes of your layer so that Keras's standard object-oriented weights and loss tracking will kick in. diff --git a/keras/legacy_tf_layers/variable_scope_shim_test.py b/tf_keras/legacy_tf_layers/variable_scope_shim_test.py similarity index 99% rename from keras/legacy_tf_layers/variable_scope_shim_test.py rename to tf_keras/legacy_tf_layers/variable_scope_shim_test.py index f593bdfa7..31cbc2b4e 100644 --- a/keras/legacy_tf_layers/variable_scope_shim_test.py +++ b/tf_keras/legacy_tf_layers/variable_scope_shim_test.py @@ -25,15 +25,15 @@ import tensorflow as tf from absl.testing import parameterized -from keras import models -from keras import regularizers -from keras.engine import base_layer -from keras.engine import input_layer as input_layer_module -from keras.engine import training as training_module -from keras.layers import core -from keras.legacy_tf_layers import core as core_layers -from keras.legacy_tf_layers import variable_scope_shim -from keras.testing_infra import test_combinations +from tf_keras import models +from tf_keras import regularizers +from tf_keras.engine import base_layer +from tf_keras.engine import input_layer as input_layer_module +from tf_keras.engine import training as training_module +from tf_keras.layers import core +from tf_keras.legacy_tf_layers import core as core_layers +from tf_keras.legacy_tf_layers import variable_scope_shim +from tf_keras.testing_infra import test_combinations # isort: off from tensorflow.python.framework import ( @@ -1537,7 +1537,7 @@ def call(self, inputs): self.assertEmpty(layer.weights) def test_embedded_keras_model(self): - # Test the shim when embedding a Keras model inside of it + # Test the shim when embedding a TF-Keras model inside of it # And assigning the model to an attribute class WrappedDenseLayer(base_layer.Layer): @@ -1577,7 +1577,7 @@ def call(self, inputs): self.assertAllEqual(tf.add_n(layer.losses), 2) def test_embedded_keras_model_in_module(self): - # Test the module shim when embedding a Keras model inside of it + # Test the module shim when embedding a TF-Keras model inside of it # And assigning the model to an attribute class WrappedDenseLayer(VariableScopeModule): @@ -1624,7 +1624,7 @@ def forward_pass(self, inputs): self.assertEmpty(layer.get_compat_v1_regularization_losses()) def test_training_arg(self): - # Test the shim when passing in a Keras `training` arg + # Test the shim when passing in a TF-Keras `training` arg class TrainingCheckLayer(base_layer.Layer): def __init__(self, units, *args, **kwargs): diff --git a/keras/losses.py b/tf_keras/losses.py similarity index 99% rename from keras/losses.py rename to tf_keras/losses.py index dc325e679..f347368a1 100644 --- a/keras/losses.py +++ b/tf_keras/losses.py @@ -22,13 +22,13 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.saving import saving_lib -from keras.saving.legacy import serialization as legacy_serialization -from keras.saving.serialization_lib import deserialize_keras_object -from keras.saving.serialization_lib import serialize_keras_object -from keras.utils import losses_utils -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.saving import saving_lib +from tf_keras.saving.legacy import serialization as legacy_serialization +from tf_keras.saving.serialization_lib import deserialize_keras_object +from tf_keras.saving.serialization_lib import serialize_keras_object +from tf_keras.utils import losses_utils +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.ops.ragged import ragged_map_ops @@ -277,7 +277,7 @@ def get_config(self): ) if saving_lib.saving_v3_enabled(): - from keras.utils import get_registered_name + from tf_keras.utils import get_registered_name config["fn"] = get_registered_name(self.fn) @@ -2873,7 +2873,7 @@ def serialize(loss, use_legacy_format=False): """Serializes loss function or `Loss` instance. Args: - loss: A Keras `Loss` instance or a loss function. + loss: A TF-Keras `Loss` instance or a loss function. use_legacy_format: Boolean, whether to use the legacy serialization format. Defaults to `False`. @@ -2906,7 +2906,7 @@ def deserialize(name, custom_objects=None, use_legacy_format=False): format. Defaults to `False`. Returns: - A Keras `Loss` instance or a loss function. + A TF-Keras `Loss` instance or a loss function. """ if use_legacy_format: return legacy_serialization.deserialize_keras_object( @@ -2925,7 +2925,7 @@ def deserialize(name, custom_objects=None, use_legacy_format=False): @keras_export("keras.losses.get") def get(identifier): - """Retrieves a Keras loss as a `function`/`Loss` class instance. + """Retrieves a TF-Keras loss as a `function`/`Loss` class instance. The `identifier` may be the string name of a loss function or `Loss` class. @@ -2952,7 +2952,7 @@ def get(identifier): or a loss class instance. Returns: - A Keras loss as a `function`/ `Loss` class instance. + A TF-Keras loss as a `function`/ `Loss` class instance. Raises: ValueError: If `identifier` cannot be interpreted. diff --git a/keras/losses_test.py b/tf_keras/losses_test.py similarity index 99% rename from keras/losses_test.py rename to tf_keras/losses_test.py index ba4203483..4eba2761a 100644 --- a/keras/losses_test.py +++ b/tf_keras/losses_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras loss functions.""" +"""Tests for TF-Keras loss functions.""" import warnings @@ -20,11 +20,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import activations -from keras import backend -from keras import losses -from keras.testing_infra import test_combinations -from keras.utils import losses_utils +from tf_keras import activations +from tf_keras import backend +from tf_keras import losses +from tf_keras.testing_infra import test_combinations +from tf_keras.utils import losses_utils # isort: off from tensorflow.python.autograph.impl import ( @@ -241,7 +241,7 @@ def test_sparse_categorical_crossentropy_loss_with_unknown_rank_tensor( @test_combinations.generate(test_combinations.combine(mode=["eager"])) def test_sparse_categorical_crossentropy_with_float16(self): - # See https://github.com/keras-team/keras/issues/15012 for more details. + # See https://github.com/keras-team/tf-keras/issues/15012 for more details. # we don't cast y_true to have same dtype as y_pred, since y_pred could # be float16 which has a small upbound, and the casting could cause an # underflow. The y_true will be used as int64 anyway. @@ -362,7 +362,7 @@ def tf_functioned_loss_fn(y_true, y_pred, sample_weight=None): def test_loss_wrapper_dtype(self): # Make sure the loss wrapper doesn't cause any numerical precision loss # during calculation. See - # https://github.com/keras-team/keras/issues/15791 + # https://github.com/keras-team/tf-keras/issues/15791 x = tf.convert_to_tensor([[2.1]], dtype=tf.float64) y_true = tf.square(x) y_pred = tf.convert_to_tensor([[3.68]], dtype=tf.float64) diff --git a/keras/metrics/BUILD b/tf_keras/metrics/BUILD similarity index 65% rename from keras/metrics/BUILD rename to tf_keras/metrics/BUILD index 6d259d9c8..980fe14b3 100644 --- a/keras/metrics/BUILD +++ b/tf_keras/metrics/BUILD @@ -14,16 +14,16 @@ # ============================================================================== # Description: -# Contains the Keras metrics submodule. +# Contains the TF-Keras metrics submodule. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "cuda_py_test") -load("@org_keras//keras:keras.bzl", "tf_py_test") # buildifier: disable=same-origin-load +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") # buildifier: disable=same-origin-load package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/tensorflow/python/feature_column:__subpackages__", "//third_party/tensorflow/python/tpu:__subpackages__", "//third_party/tensorflow_estimator:__subpackages__", @@ -49,17 +49,17 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:activations", - "//keras:backend", - "//keras:losses", - "//keras/distribute", - "//keras/dtensor", - "//keras/dtensor:utils", - "//keras/engine:base_layer", - "//keras/engine:base_layer_utils", - "//keras/utils:generic_utils", - "//keras/utils:metrics_utils", - "//keras/utils:tf_utils", + "//tf_keras:activations", + "//tf_keras:backend", + "//tf_keras:losses", + "//tf_keras/distribute", + "//tf_keras/dtensor", + "//tf_keras/dtensor:utils", + "//tf_keras/engine:base_layer", + "//tf_keras/engine:base_layer_utils", + "//tf_keras/utils:generic_utils", + "//tf_keras/utils:metrics_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -71,8 +71,8 @@ tf_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -86,10 +86,10 @@ tf_py_test( ":metrics", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/layers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/layers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -101,16 +101,16 @@ tf_py_test( shard_count = 4, deps = [ ":metrics", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_scipy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/layers", - "//keras/models", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", - "//keras/utils:metrics_utils", + "//tf_keras", + "//tf_keras/layers", + "//tf_keras/models", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/utils:metrics_utils", ], ) @@ -122,11 +122,11 @@ tf_py_test( shard_count = 4, deps = [ ":metrics", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -140,10 +140,10 @@ tf_py_test( ":metrics", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/layers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/layers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -157,10 +157,10 @@ tf_py_test( ":metrics", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/layers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/layers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -174,10 +174,10 @@ tf_py_test( ":metrics", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/layers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/layers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -191,8 +191,8 @@ tf_py_test( ":metrics", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -206,10 +206,10 @@ tf_py_test( ":metrics", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/layers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/layers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -220,11 +220,11 @@ tf_py_test( python_version = "PY3", shard_count = 4, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -239,9 +239,9 @@ cuda_py_test( deps = [ ":metrics", "//:expect_tensorflow_installed", - "//keras", - "//keras/layers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/layers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) diff --git a/tf_keras/metrics/__init__.py b/tf_keras/metrics/__init__.py new file mode 100644 index 000000000..e4816a1e9 --- /dev/null +++ b/tf_keras/metrics/__init__.py @@ -0,0 +1,224 @@ +# 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. +# ============================================================================== +"""All TF-Keras metrics.""" + +# isort: off +import warnings +from tensorflow.python.util.tf_export import keras_export + +# Base classes and utilities +from tf_keras.metrics.base_metric import Mean +from tf_keras.metrics.base_metric import MeanMetricWrapper +from tf_keras.metrics.base_metric import MeanTensor +from tf_keras.metrics.base_metric import Metric +from tf_keras.metrics.base_metric import Reduce +from tf_keras.metrics.base_metric import Sum +from tf_keras.metrics.base_metric import SumOverBatchSize +from tf_keras.metrics.base_metric import SumOverBatchSizeMetricWrapper +from tf_keras.metrics.base_metric import clone_metric +from tf_keras.metrics.base_metric import clone_metrics + +from tf_keras.saving.legacy import serialization as legacy_serialization +from tf_keras.saving.serialization_lib import deserialize_keras_object +from tf_keras.saving.serialization_lib import serialize_keras_object + +from tf_keras.metrics.py_metric import PyMetric + +# Individual metric classes + +# Accuracy metrics +from tf_keras.metrics.accuracy_metrics import Accuracy +from tf_keras.metrics.accuracy_metrics import BinaryAccuracy +from tf_keras.metrics.accuracy_metrics import CategoricalAccuracy +from tf_keras.metrics.accuracy_metrics import SparseCategoricalAccuracy +from tf_keras.metrics.accuracy_metrics import SparseTopKCategoricalAccuracy +from tf_keras.metrics.accuracy_metrics import TopKCategoricalAccuracy + +from tf_keras.metrics.accuracy_metrics import accuracy +from tf_keras.metrics.accuracy_metrics import binary_accuracy +from tf_keras.metrics.accuracy_metrics import categorical_accuracy +from tf_keras.metrics.accuracy_metrics import sparse_categorical_accuracy +from tf_keras.metrics.accuracy_metrics import sparse_top_k_categorical_accuracy +from tf_keras.metrics.accuracy_metrics import top_k_categorical_accuracy + +# Probabilistic metrics +from tf_keras.metrics.probabilistic_metrics import BinaryCrossentropy +from tf_keras.metrics.probabilistic_metrics import CategoricalCrossentropy +from tf_keras.metrics.probabilistic_metrics import KLDivergence +from tf_keras.metrics.probabilistic_metrics import Poisson +from tf_keras.metrics.probabilistic_metrics import SparseCategoricalCrossentropy + +from tf_keras.metrics.probabilistic_metrics import binary_crossentropy +from tf_keras.metrics.probabilistic_metrics import categorical_crossentropy +from tf_keras.metrics.probabilistic_metrics import poisson +from tf_keras.metrics.probabilistic_metrics import kullback_leibler_divergence +from tf_keras.metrics.probabilistic_metrics import sparse_categorical_crossentropy + +# Regression metrics +from tf_keras.metrics.regression_metrics import CosineSimilarity +from tf_keras.metrics.regression_metrics import LogCoshError +from tf_keras.metrics.regression_metrics import MeanAbsoluteError +from tf_keras.metrics.regression_metrics import MeanAbsolutePercentageError +from tf_keras.metrics.regression_metrics import MeanRelativeError +from tf_keras.metrics.regression_metrics import MeanSquaredError +from tf_keras.metrics.regression_metrics import MeanSquaredLogarithmicError +from tf_keras.metrics.regression_metrics import RootMeanSquaredError +from tf_keras.metrics.regression_metrics import R2Score + +from tf_keras.metrics.regression_metrics import cosine_similarity +from tf_keras.metrics.regression_metrics import logcosh +from tf_keras.metrics.regression_metrics import mean_absolute_error +from tf_keras.metrics.regression_metrics import mean_absolute_percentage_error +from tf_keras.metrics.regression_metrics import mean_squared_error +from tf_keras.metrics.regression_metrics import mean_squared_logarithmic_error + +# Confusion metrics +from tf_keras.metrics.confusion_metrics import AUC +from tf_keras.metrics.confusion_metrics import FalseNegatives +from tf_keras.metrics.confusion_metrics import FalsePositives +from tf_keras.metrics.confusion_metrics import Precision +from tf_keras.metrics.confusion_metrics import PrecisionAtRecall +from tf_keras.metrics.confusion_metrics import Recall +from tf_keras.metrics.confusion_metrics import RecallAtPrecision +from tf_keras.metrics.confusion_metrics import SensitivityAtSpecificity +from tf_keras.metrics.confusion_metrics import SensitivitySpecificityBase +from tf_keras.metrics.confusion_metrics import SpecificityAtSensitivity +from tf_keras.metrics.confusion_metrics import TrueNegatives +from tf_keras.metrics.confusion_metrics import TruePositives + +# F-Scores +from tf_keras.metrics.f_score_metrics import FBetaScore +from tf_keras.metrics.f_score_metrics import F1Score + +# IoU metrics +from tf_keras.metrics.iou_metrics import BinaryIoU +from tf_keras.metrics.iou_metrics import IoU +from tf_keras.metrics.iou_metrics import MeanIoU +from tf_keras.metrics.iou_metrics import OneHotIoU +from tf_keras.metrics.iou_metrics import OneHotMeanIoU + +# Hinge metrics +from tf_keras.metrics.hinge_metrics import CategoricalHinge +from tf_keras.metrics.hinge_metrics import Hinge +from tf_keras.metrics.hinge_metrics import SquaredHinge + +from tf_keras.metrics.hinge_metrics import categorical_hinge +from tf_keras.metrics.hinge_metrics import squared_hinge +from tf_keras.metrics.hinge_metrics import hinge + +# Aliases +acc = ACC = accuracy +bce = BCE = binary_crossentropy +mse = MSE = mean_squared_error +mae = MAE = mean_absolute_error +mape = MAPE = mean_absolute_percentage_error +msle = MSLE = mean_squared_logarithmic_error +log_cosh = logcosh +cosine_proximity = cosine_similarity + + +@keras_export("keras.metrics.serialize") +def serialize(metric, use_legacy_format=False): + """Serializes metric function or `Metric` instance. + + Args: + metric: A TF-Keras `Metric` instance or a metric function. + + Returns: + Metric configuration dictionary. + """ + if metric is None: + return None + if not isinstance(metric, Metric): + warnings.warn( + "The `keras.metrics.serialize()` API should only be used for " + "objects of type `keras.metrics.Metric`. Found an instance of " + f"type {type(metric)}, which may lead to improper serialization." + ) + if use_legacy_format: + return legacy_serialization.serialize_keras_object(metric) + return serialize_keras_object(metric) + + +@keras_export("keras.metrics.deserialize") +def deserialize(config, custom_objects=None, use_legacy_format=False): + """Deserializes a serialized metric class/function instance. + + Args: + config: Metric configuration. + custom_objects: Optional dictionary mapping names (strings) to custom + objects (classes and functions) to be considered during deserialization. + + Returns: + A TF-Keras `Metric` instance or a metric function. + """ + if use_legacy_format: + return legacy_serialization.deserialize_keras_object( + config, + module_objects=globals(), + custom_objects=custom_objects, + printable_module_name="metric function", + ) + return deserialize_keras_object( + config, + module_objects=globals(), + custom_objects=custom_objects, + printable_module_name="metric function", + ) + + +@keras_export("keras.metrics.get") +def get(identifier): + """Retrieves a TF-Keras metric as a `function`/`Metric` class instance. + + The `identifier` may be the string name of a metric function or class. + + >>> metric = tf.keras.metrics.get("categorical_crossentropy") + >>> type(metric) + + >>> metric = tf.keras.metrics.get("CategoricalCrossentropy") + >>> type(metric) + + + You can also specify `config` of the metric to this function by passing dict + containing `class_name` and `config` as an identifier. Also note that the + `class_name` must map to a `Metric` class + + >>> identifier = {"class_name": "CategoricalCrossentropy", + ... "config": {"from_logits": True}} + >>> metric = tf.keras.metrics.get(identifier) + >>> type(metric) + + + Args: + identifier: A metric identifier. One of None or string name of a metric + function/class or metric configuration dictionary or a metric function + or a metric class instance + + Returns: + A TF-Keras metric as a `function`/ `Metric` class instance. + + Raises: + ValueError: If `identifier` cannot be interpreted. + """ + if isinstance(identifier, dict): + use_legacy_format = "module" not in identifier + return deserialize(identifier, use_legacy_format=use_legacy_format) + elif isinstance(identifier, str): + return deserialize(str(identifier)) + elif callable(identifier): + return identifier + else: + raise ValueError(f"Could not interpret metric identifier: {identifier}") diff --git a/keras/metrics/accuracy_metrics.py b/tf_keras/metrics/accuracy_metrics.py similarity index 99% rename from keras/metrics/accuracy_metrics.py rename to tf_keras/metrics/accuracy_metrics.py index 98e130a8e..abb1f7711 100644 --- a/keras/metrics/accuracy_metrics.py +++ b/tf_keras/metrics/accuracy_metrics.py @@ -16,10 +16,10 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.dtensor import utils as dtensor_utils -from keras.metrics import base_metric -from keras.utils import metrics_utils +from tf_keras import backend +from tf_keras.dtensor import utils as dtensor_utils +from tf_keras.metrics import base_metric +from tf_keras.utils import metrics_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/metrics/accuracy_metrics_test.py b/tf_keras/metrics/accuracy_metrics_test.py similarity index 99% rename from keras/metrics/accuracy_metrics_test.py rename to tf_keras/metrics/accuracy_metrics_test.py index a89ded801..cef39df32 100644 --- a/keras/metrics/accuracy_metrics_test.py +++ b/tf_keras/metrics/accuracy_metrics_test.py @@ -16,10 +16,10 @@ import tensorflow.compat.v2 as tf -from keras import Model -from keras import layers -from keras import metrics -from keras.testing_infra import test_combinations +from tf_keras import Model +from tf_keras import layers +from tf_keras import metrics +from tf_keras.testing_infra import test_combinations @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/metrics/base_metric.py b/tf_keras/metrics/base_metric.py similarity index 98% rename from keras/metrics/base_metric.py rename to tf_keras/metrics/base_metric.py index 7a56b4d13..1c887b001 100644 --- a/keras/metrics/base_metric.py +++ b/tf_keras/metrics/base_metric.py @@ -21,17 +21,17 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.dtensor import dtensor_api as dtensor -from keras.dtensor import utils as dtensor_utils -from keras.engine import base_layer -from keras.engine import base_layer_utils -from keras.engine import keras_tensor -from keras.saving.legacy.saved_model import metric_serialization -from keras.utils import generic_utils -from keras.utils import losses_utils -from keras.utils import metrics_utils -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.dtensor import dtensor_api as dtensor +from tf_keras.dtensor import utils as dtensor_utils +from tf_keras.engine import base_layer +from tf_keras.engine import base_layer_utils +from tf_keras.engine import keras_tensor +from tf_keras.saving.legacy.saved_model import metric_serialization +from tf_keras.utils import generic_utils +from tf_keras.utils import losses_utils +from tf_keras.utils import metrics_utils +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -209,7 +209,7 @@ def replica_local_fn(*args, **kwargs): result_t._metric_obj = self return result_t - from keras.distribute import ( + from tf_keras.distribute import ( distributed_training_utils, ) @@ -226,7 +226,7 @@ def __deepcopy__(self, memo=None): new_self = self.from_config(self.get_config()) except NotImplementedError as e: raise NotImplementedError( - "Calling `__deepcopy__()` on a Keras metric " + "Calling `__deepcopy__()` on a TF-Keras metric " "requires the metric to be serializable, " "i.e. it should implement `get_config()`.\n\n" f"Error encountered during serialization: [{e}]" @@ -357,7 +357,7 @@ def add_weight( additional_kwargs = {} - # TODO(b/120571621): Make `ON_READ` work with Keras metrics on TPU. + # TODO(b/120571621): Make `ON_READ` work with TF-Keras metrics on TPU. if backend.is_tpu_strategy(strategy): synchronization = tf.VariableSynchronization.ON_WRITE if getattr(self, "_mesh", None) is not None: @@ -743,7 +743,7 @@ def get_config(self): @classmethod def from_config(cls, config): - from keras.metrics import get + from tf_keras.metrics import get # Note that while MeanMetricWrapper itself isn't public, objects of this # class may be created and added to the model by calling model.compile. diff --git a/keras/metrics/base_metric_test.py b/tf_keras/metrics/base_metric_test.py similarity index 98% rename from keras/metrics/base_metric_test.py rename to tf_keras/metrics/base_metric_test.py index d7287179f..5ec07aa1d 100644 --- a/keras/metrics/base_metric_test.py +++ b/tf_keras/metrics/base_metric_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras base Metric classes.""" +"""Tests for TF-Keras base Metric classes.""" import copy import os @@ -21,13 +21,13 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import Model -from keras import layers -from keras import metrics -from keras.engine import base_layer -from keras.engine import training as training_module -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras import Model +from tf_keras import layers +from tf_keras import metrics +from tf_keras.engine import base_layer +from tf_keras.engine import training as training_module +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/metrics/confusion_metrics.py b/tf_keras/metrics/confusion_metrics.py similarity index 99% rename from keras/metrics/confusion_metrics.py rename to tf_keras/metrics/confusion_metrics.py index 75584ff79..c68d7710a 100644 --- a/keras/metrics/confusion_metrics.py +++ b/tf_keras/metrics/confusion_metrics.py @@ -19,13 +19,13 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import activations -from keras import backend -from keras.dtensor import utils as dtensor_utils -from keras.metrics import base_metric -from keras.utils import metrics_utils -from keras.utils.generic_utils import to_list -from keras.utils.tf_utils import is_tensor_or_variable +from tf_keras import activations +from tf_keras import backend +from tf_keras.dtensor import utils as dtensor_utils +from tf_keras.metrics import base_metric +from tf_keras.utils import metrics_utils +from tf_keras.utils.generic_utils import to_list +from tf_keras.utils.tf_utils import is_tensor_or_variable # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/metrics/confusion_metrics_test.py b/tf_keras/metrics/confusion_metrics_test.py similarity index 99% rename from keras/metrics/confusion_metrics_test.py rename to tf_keras/metrics/confusion_metrics_test.py index a647e4efc..0f2d1c220 100644 --- a/keras/metrics/confusion_metrics_test.py +++ b/tf_keras/metrics/confusion_metrics_test.py @@ -21,13 +21,13 @@ from absl.testing import parameterized from tensorflow.python.platform import tf_logging -from keras import backend -from keras import layers -from keras import metrics -from keras import models -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import metrics_utils +from tf_keras import backend +from tf_keras import layers +from tf_keras import metrics +from tf_keras import models +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import metrics_utils @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/metrics/f_score_metrics.py b/tf_keras/metrics/f_score_metrics.py similarity index 99% rename from keras/metrics/f_score_metrics.py rename to tf_keras/metrics/f_score_metrics.py index 3e59a0de0..1472290e7 100644 --- a/keras/metrics/f_score_metrics.py +++ b/tf_keras/metrics/f_score_metrics.py @@ -17,8 +17,8 @@ import tensorflow.compat.v2 as tf from tensorflow.python.util.tf_export import keras_export -from keras.dtensor import utils as dtensor_utils -from keras.metrics import base_metric +from tf_keras.dtensor import utils as dtensor_utils +from tf_keras.metrics import base_metric # Adapted from TF-Addons implementation. diff --git a/keras/metrics/f_score_metrics_test.py b/tf_keras/metrics/f_score_metrics_test.py similarity index 99% rename from keras/metrics/f_score_metrics_test.py rename to tf_keras/metrics/f_score_metrics_test.py index 8854467ad..6482ea19e 100644 --- a/keras/metrics/f_score_metrics_test.py +++ b/tf_keras/metrics/f_score_metrics_test.py @@ -17,8 +17,8 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.metrics import f_score_metrics -from keras.testing_infra import test_utils +from tf_keras.metrics import f_score_metrics +from tf_keras.testing_infra import test_utils @test_utils.run_v2_only diff --git a/keras/metrics/hinge_metrics.py b/tf_keras/metrics/hinge_metrics.py similarity index 94% rename from keras/metrics/hinge_metrics.py rename to tf_keras/metrics/hinge_metrics.py index ff49472c8..152cd0f31 100644 --- a/keras/metrics/hinge_metrics.py +++ b/tf_keras/metrics/hinge_metrics.py @@ -14,11 +14,11 @@ # ============================================================================== """Hinge metrics.""" -from keras.dtensor import utils as dtensor_utils -from keras.losses import categorical_hinge -from keras.losses import hinge -from keras.losses import squared_hinge -from keras.metrics import base_metric +from tf_keras.dtensor import utils as dtensor_utils +from tf_keras.losses import categorical_hinge +from tf_keras.losses import hinge +from tf_keras.losses import squared_hinge +from tf_keras.metrics import base_metric # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/metrics/hinge_metrics_test.py b/tf_keras/metrics/hinge_metrics_test.py similarity index 98% rename from keras/metrics/hinge_metrics_test.py rename to tf_keras/metrics/hinge_metrics_test.py index d5b093142..47f44a7c2 100644 --- a/keras/metrics/hinge_metrics_test.py +++ b/tf_keras/metrics/hinge_metrics_test.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras metrics.""" +"""Tests for TF-Keras metrics.""" import tensorflow.compat.v2 as tf -from keras import metrics -from keras.testing_infra import test_combinations +from tf_keras import metrics +from tf_keras.testing_infra import test_combinations @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/metrics/iou_metrics.py b/tf_keras/metrics/iou_metrics.py similarity index 99% rename from keras/metrics/iou_metrics.py rename to tf_keras/metrics/iou_metrics.py index 377ef8858..729722199 100644 --- a/keras/metrics/iou_metrics.py +++ b/tf_keras/metrics/iou_metrics.py @@ -22,9 +22,9 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.dtensor import utils as dtensor_utils -from keras.metrics import base_metric +from tf_keras import backend +from tf_keras.dtensor import utils as dtensor_utils +from tf_keras.metrics import base_metric # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/metrics/iou_metrics_test.py b/tf_keras/metrics/iou_metrics_test.py similarity index 99% rename from keras/metrics/iou_metrics_test.py rename to tf_keras/metrics/iou_metrics_test.py index a642abeee..da81f7b92 100644 --- a/keras/metrics/iou_metrics_test.py +++ b/tf_keras/metrics/iou_metrics_test.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras metrics.""" +"""Tests for TF-Keras metrics.""" import tensorflow.compat.v2 as tf -from keras import metrics -from keras.testing_infra import test_combinations +from tf_keras import metrics +from tf_keras.testing_infra import test_combinations @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/metrics/metrics_correctness_test.py b/tf_keras/metrics/metrics_correctness_test.py similarity index 99% rename from keras/metrics/metrics_correctness_test.py rename to tf_keras/metrics/metrics_correctness_test.py index 6532a1512..1c70d864c 100644 --- a/keras/metrics/metrics_correctness_test.py +++ b/tf_keras/metrics/metrics_correctness_test.py @@ -12,18 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests metrics correctness using Keras model.""" +"""Tests metrics correctness using TF-Keras model.""" import numpy as np import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import layers -from keras import losses -from keras import metrics -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import losses_utils +from tf_keras import layers +from tf_keras import losses +from tf_keras import metrics +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import losses_utils def get_multi_io_model(): diff --git a/keras/metrics/metrics_functional_test.py b/tf_keras/metrics/metrics_functional_test.py similarity index 98% rename from keras/metrics/metrics_functional_test.py rename to tf_keras/metrics/metrics_functional_test.py index c52a2f4ce..a89ee8de5 100644 --- a/keras/metrics/metrics_functional_test.py +++ b/tf_keras/metrics/metrics_functional_test.py @@ -12,15 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras metrics functions.""" +"""Tests for TF-Keras metrics functions.""" import numpy as np import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import backend -from keras import metrics -from keras.testing_infra import test_combinations +from tf_keras import backend +from tf_keras import metrics +from tf_keras.testing_infra import test_combinations class KerasFunctionalMetricsTest(tf.test.TestCase, parameterized.TestCase): diff --git a/keras/metrics/probabilistic_metrics.py b/tf_keras/metrics/probabilistic_metrics.py similarity index 97% rename from keras/metrics/probabilistic_metrics.py rename to tf_keras/metrics/probabilistic_metrics.py index c2c8d4871..de37cd602 100644 --- a/keras/metrics/probabilistic_metrics.py +++ b/tf_keras/metrics/probabilistic_metrics.py @@ -19,13 +19,13 @@ import tensorflow.compat.v2 as tf -from keras.dtensor import utils as dtensor_utils -from keras.losses import binary_crossentropy -from keras.losses import categorical_crossentropy -from keras.losses import kullback_leibler_divergence -from keras.losses import poisson -from keras.losses import sparse_categorical_crossentropy -from keras.metrics import base_metric +from tf_keras.dtensor import utils as dtensor_utils +from tf_keras.losses import binary_crossentropy +from tf_keras.losses import categorical_crossentropy +from tf_keras.losses import kullback_leibler_divergence +from tf_keras.losses import poisson +from tf_keras.losses import sparse_categorical_crossentropy +from tf_keras.metrics import base_metric # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/metrics/probabilistic_metrics_test.py b/tf_keras/metrics/probabilistic_metrics_test.py similarity index 99% rename from keras/metrics/probabilistic_metrics_test.py rename to tf_keras/metrics/probabilistic_metrics_test.py index 0a2e8577d..37d28795c 100644 --- a/keras/metrics/probabilistic_metrics_test.py +++ b/tf_keras/metrics/probabilistic_metrics_test.py @@ -12,15 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras metrics.""" +"""Tests for TF-Keras metrics.""" import json import numpy as np import tensorflow.compat.v2 as tf -from keras import metrics -from keras.testing_infra import test_combinations +from tf_keras import metrics +from tf_keras.testing_infra import test_combinations @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/metrics/py_metric.py b/tf_keras/metrics/py_metric.py similarity index 98% rename from keras/metrics/py_metric.py rename to tf_keras/metrics/py_metric.py index e07182031..591d81ef2 100644 --- a/keras/metrics/py_metric.py +++ b/tf_keras/metrics/py_metric.py @@ -1,4 +1,4 @@ -# Copyright 2023 The Keras Authors. All Rights Reserved. +# Copyright 2023 The TF-Keras 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. @@ -19,7 +19,7 @@ import tensorflow.compat.v2 as tf from tensorflow.python.util.tf_export import keras_export -from keras.metrics import base_metric +from tf_keras.metrics import base_metric @keras_export("keras.metrics.experimental.PyMetric", v1=[]) diff --git a/keras/metrics/py_metric_test.py b/tf_keras/metrics/py_metric_test.py similarity index 96% rename from keras/metrics/py_metric_test.py rename to tf_keras/metrics/py_metric_test.py index d8f00d3a5..cccd996b2 100644 --- a/keras/metrics/py_metric_test.py +++ b/tf_keras/metrics/py_metric_test.py @@ -1,4 +1,4 @@ -# Copyright 2023 The Keras Authors. All Rights Reserved. +# Copyright 2023 The TF-Keras 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. @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras PyMetric classes.""" +"""Tests for TF-Keras PyMetric classes.""" import tensorflow.compat.v2 as tf -from keras import metrics -from keras.testing_infra import test_combinations +from tf_keras import metrics +from tf_keras.testing_infra import test_combinations class KTrimmedMean(metrics.PyMetric): diff --git a/keras/metrics/regression_metrics.py b/tf_keras/metrics/regression_metrics.py similarity index 97% rename from keras/metrics/regression_metrics.py rename to tf_keras/metrics/regression_metrics.py index ccc4702f6..5090d315c 100644 --- a/keras/metrics/regression_metrics.py +++ b/tf_keras/metrics/regression_metrics.py @@ -18,17 +18,17 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.dtensor import utils as dtensor_utils -from keras.losses import logcosh -from keras.losses import mean_absolute_error -from keras.losses import mean_absolute_percentage_error -from keras.losses import mean_squared_error -from keras.losses import mean_squared_logarithmic_error -from keras.metrics import base_metric -from keras.utils import losses_utils -from keras.utils import metrics_utils -from keras.utils.tf_utils import is_tensor_or_variable +from tf_keras import backend +from tf_keras.dtensor import utils as dtensor_utils +from tf_keras.losses import logcosh +from tf_keras.losses import mean_absolute_error +from tf_keras.losses import mean_absolute_percentage_error +from tf_keras.losses import mean_squared_error +from tf_keras.losses import mean_squared_logarithmic_error +from tf_keras.metrics import base_metric +from tf_keras.utils import losses_utils +from tf_keras.utils import metrics_utils +from tf_keras.utils.tf_utils import is_tensor_or_variable # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/metrics/regression_metrics_test.py b/tf_keras/metrics/regression_metrics_test.py similarity index 99% rename from keras/metrics/regression_metrics_test.py rename to tf_keras/metrics/regression_metrics_test.py index 57b1a8191..9e75ba82a 100644 --- a/keras/metrics/regression_metrics_test.py +++ b/tf_keras/metrics/regression_metrics_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras metrics.""" +"""Tests for TF-Keras metrics.""" import math @@ -20,10 +20,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import Input -from keras import metrics -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras import Input +from tf_keras import metrics +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/mixed_precision/BUILD b/tf_keras/mixed_precision/BUILD similarity index 71% rename from keras/mixed_precision/BUILD rename to tf_keras/mixed_precision/BUILD index d29b50840..1d2b1dfa1 100644 --- a/keras/mixed_precision/BUILD +++ b/tf_keras/mixed_precision/BUILD @@ -14,18 +14,18 @@ # ============================================================================== # Description: -# Contains the Keras Mixed Precision API (TensorFlow version). +# Contains the TF-Keras Mixed Precision API (TensorFlow version). # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "cuda_py_test") -load("@org_keras//keras:keras.bzl", "tf_py_test") # buildifier: disable=same-origin-load +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") # buildifier: disable=same-origin-load package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ # TODO(scottzhu): Remove these two deps and convert the test to integration test. "//third_party/tensorflow/python/distribute:__pkg__", # For collective_all_reduce_strategy_test - "//keras:friends", + "//tf_keras:friends", "//third_party/tensorflow/tools/pip_package:__pkg__", ], licenses = ["notice"], @@ -65,9 +65,9 @@ tf_py_test( deps = [ ":policy", "//:expect_tensorflow_installed", - "//keras", - "//keras/optimizers/legacy:optimizers", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/optimizers/legacy:optimizers", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -87,7 +87,7 @@ cuda_py_test( deps = [ ":device_compatibility_check", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -99,7 +99,7 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/distribute", + "//tf_keras/distribute", ], ) @@ -110,10 +110,10 @@ tf_py_test( python_version = "PY3", deps = [ ":autocast_variable", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/layers", - "//keras/optimizers/legacy:optimizers", + "//tf_keras/layers", + "//tf_keras/optimizers/legacy:optimizers", ], ) @@ -122,10 +122,10 @@ py_library( srcs = ["loss_scale_optimizer.py"], srcs_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/optimizers/legacy:optimizers", - "//keras/utils:generic_utils", + "//tf_keras/optimizers/legacy:optimizers", + "//tf_keras/utils:generic_utils", ], ) @@ -139,8 +139,8 @@ cuda_py_test( ":loss_scale_optimizer", ":test_util", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -152,12 +152,12 @@ cuda_py_test( deps = [ ":loss_scale_optimizer", ":policy", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/optimizers/legacy:optimizers", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/optimizers/legacy:optimizers", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -167,7 +167,7 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -182,10 +182,10 @@ cuda_py_test( ], deps = [ ":test_util", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -194,8 +194,8 @@ cuda_py_test( size = "medium", srcs = ["model_test.py"], data = [ - "//keras/mixed_precision/testdata:lso_ckpt_tf2.2", - "//keras/mixed_precision/testdata:lso_savedmodel_tf2.2", + "//tf_keras/mixed_precision/testdata:lso_ckpt_tf2.2", + "//tf_keras/mixed_precision/testdata:lso_savedmodel_tf2.2", ], python_version = "PY3", shard_count = 5, @@ -205,10 +205,10 @@ cuda_py_test( ], deps = [ ":test_util", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -222,9 +222,9 @@ cuda_py_test( "no_rocm", ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/keras/mixed_precision/__init__.py b/tf_keras/mixed_precision/__init__.py similarity index 70% rename from keras/mixed_precision/__init__.py rename to tf_keras/mixed_precision/__init__.py index 58c7cd947..c58bd96b3 100644 --- a/keras/mixed_precision/__init__.py +++ b/tf_keras/mixed_precision/__init__.py @@ -15,11 +15,11 @@ """Keras mixed precision API. See [the mixed precision guide]( - https://www.tensorflow.org/guide/keras/mixed_precision) to learn how to + https://www.tensorflow.org/guide/tf_keras/mixed_precision) to learn how to use the API. """ -from keras.mixed_precision.loss_scale_optimizer import LossScaleOptimizer -from keras.mixed_precision.policy import Policy -from keras.mixed_precision.policy import global_policy -from keras.mixed_precision.policy import set_global_policy +from tf_keras.mixed_precision.loss_scale_optimizer import LossScaleOptimizer +from tf_keras.mixed_precision.policy import Policy +from tf_keras.mixed_precision.policy import global_policy +from tf_keras.mixed_precision.policy import set_global_policy diff --git a/keras/mixed_precision/autocast_variable.py b/tf_keras/mixed_precision/autocast_variable.py similarity index 95% rename from keras/mixed_precision/autocast_variable.py rename to tf_keras/mixed_precision/autocast_variable.py index eea3192b8..4d2360033 100644 --- a/keras/mixed_precision/autocast_variable.py +++ b/tf_keras/mixed_precision/autocast_variable.py @@ -19,7 +19,7 @@ import tensorflow.compat.v2 as tf -from keras.distribute import distributed_training_utils +from tf_keras.distribute import distributed_training_utils # _autocast_dtype.dtype is the dtype AutoCastVariables should be cast to, or # None if AutoCastVariables should not be cast. @@ -60,10 +60,10 @@ def placeholder_value(self, placeholder_context=None): """Use the AutoCastVariable value itself as a placeholder.""" return self._value - def _cast(self, value, _): + def cast(self, value, _): return value - def _to_tensors(self, value): + def to_tensors(self, value): return [] def __hash__(self) -> int: @@ -91,7 +91,7 @@ class AutoCastVariable(tf.Variable, tf.__internal__.types.Tensor): ... tf.identity(v).dtype tf.float16 - The purpose of this class is to allow Keras layers to create variables in + The purpose of this class is to allow TF-Keras layers to create variables in float32, and automatically cast them to float16 or bfloat16 when the layer is called. """ @@ -426,6 +426,17 @@ def _export_to_saved_model_graph( object_map[self] = object_map[self._variable] return resource_list + def _copy_trackable_to_cpu(self, object_map): + """For implementing `Trackable`.""" + # Create a copy of `self._variable` to object_map, then create a new + # copy of self that wraps the **copy** of `self._variable`. + # When updating value, only the lowest-level variable will actually + # update, since `AutoCastVariable` here is like a shell. + self._variable._copy_trackable_to_cpu(object_map) # pylint:disable=protected-access + if self not in object_map: + # If not populated already, populate self into the object map + object_map[self] = AutoCastVariable(object_map[self._variable]) + # TODO(reedwm): Maybe encode the fact the variable is an AutoCastVariable in # to_proto(). def to_proto(self, export_scope=None): @@ -437,7 +448,7 @@ def from_proto(self, variable_def, import_scope=None): # Delegate the private attributes _handle_name and _initializer_op to # self._variable. SavedModel sets these attributes when loading a model. For # example, it sets _handle_name here: - # https://github.com/tensorflow/tensorflow/blob/db26bd574fa95b5bdd53c08463dd19407cc0297e/tensorflow/python/keras/saving/saved_model/load.py#L211 + # https://github.com/tensorflow/tensorflow/blob/db26bd574fa95b5bdd53c08463dd19407cc0297e/tensorflow/python/tf_keras/saving/saved_model/load.py#L211 # We need to expose these attributes on AutoCastVariable as well for # SavedModel to work properly. # TODO(reedwm/kathywu): Find a better way to support SavedModel. Exposing diff --git a/keras/mixed_precision/autocast_variable_test.py b/tf_keras/mixed_precision/autocast_variable_test.py similarity index 92% rename from keras/mixed_precision/autocast_variable_test.py rename to tf_keras/mixed_precision/autocast_variable_test.py index 1a6637b6f..bf7d8fab3 100644 --- a/keras/mixed_precision/autocast_variable_test.py +++ b/tf_keras/mixed_precision/autocast_variable_test.py @@ -21,16 +21,18 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.layers import Dense -from keras.mixed_precision import autocast_variable -from keras.optimizers.legacy import adadelta -from keras.optimizers.legacy import adagrad -from keras.optimizers.legacy import adam -from keras.optimizers.legacy import adamax -from keras.optimizers.legacy import ftrl -from keras.optimizers.legacy import gradient_descent as gradient_descent_v2 -from keras.optimizers.legacy import nadam -from keras.optimizers.legacy import rmsprop +from tensorflow.python.eager import test + +from tf_keras.layers import Dense +from tf_keras.mixed_precision import autocast_variable +from tf_keras.optimizers.legacy import adadelta +from tf_keras.optimizers.legacy import adagrad +from tf_keras.optimizers.legacy import adam +from tf_keras.optimizers.legacy import adamax +from tf_keras.optimizers.legacy import ftrl +from tf_keras.optimizers.legacy import gradient_descent as gradient_descent_v2 +from tf_keras.optimizers.legacy import nadam +from tf_keras.optimizers.legacy import rmsprop maybe_distribute = tf.__internal__.test.combinations.combine( distribution=[ @@ -44,10 +46,38 @@ def get_var(val, dtype, name=None): return tf.Variable(val, dtype=dtype, name=name) +def checkpoint_test_helper(test_case, distribution, enable_async_ckpt): + with test_case.test_session(): + with distribution.scope(): + x = get_var(1.0, tf.float32) + x = autocast_variable.create_autocast_variable(x) + test_case.evaluate(x.initializer) + test_case.evaluate(x.assign(123.0)) + + checkpoint = tf.train.Checkpoint(x=x) + ckpt_options = tf.train.CheckpointOptions( + experimental_enable_async_checkpoint=enable_async_ckpt) + prefix = os.path.join(test_case.get_temp_dir(), "ckpt") + save_path = checkpoint.save(prefix, options=ckpt_options) + test_case.evaluate(x.assign(234.0)) + test_case.assertNotAllClose(123.0, x.read_value()) + checkpoint.restore(save_path).assert_consumed().run_restore_ops() + test_case.assertEqual(test_case.evaluate(x), 123.0) + + # Another round of saving/restoring to ensure that the logic of + # _copy_trackable_to_cpu works when a copy is already created in + # object_map. + test_case.evaluate(x.assign(345.0)) + save_path = checkpoint.save(prefix, options=ckpt_options) + test_case.evaluate(x.assign(456.0)) + checkpoint.restore(save_path).assert_consumed().run_restore_ops() + test_case.assertEqual(test_case.evaluate(x), 345.0) + + @tf.__internal__.distribute.combinations.generate( tf.__internal__.test.combinations.combine(mode=["graph", "eager"]) ) -class AutoCastVariableTest(tf.test.TestCase, parameterized.TestCase): +class AutoCastVariableTest(test.TestCase, parameterized.TestCase): @tf.__internal__.distribute.combinations.generate(maybe_distribute) def test_read(self, distribution): with distribution.scope(): @@ -512,19 +542,11 @@ def f(): @tf.__internal__.distribute.combinations.generate(maybe_distribute) def test_checkpoint(self, distribution): - with self.test_session(): - with distribution.scope(): - x = get_var(1.0, tf.float32) - x = autocast_variable.create_autocast_variable(x) - self.evaluate(x.initializer) - self.evaluate(x.assign(123.0)) + checkpoint_test_helper(self, distribution, enable_async_ckpt=False) - checkpoint = tf.train.Checkpoint(x=x) - prefix = os.path.join(self.get_temp_dir(), "ckpt") - save_path = checkpoint.save(prefix) - self.evaluate(x.assign(234.0)) - checkpoint.restore(save_path).assert_consumed().run_restore_ops() - self.assertEqual(self.evaluate(x), 123.0) + @tf.__internal__.distribute.combinations.generate(maybe_distribute) + def test_asyncCheckpoint(self, distribution): + checkpoint_test_helper(self, distribution, enable_async_ckpt=True) @tf.__internal__.distribute.combinations.generate(maybe_distribute) def test_invalid_wrapped_variable(self, distribution): @@ -657,4 +679,4 @@ def f(): if __name__ == "__main__": - tf.test.main() + test.main() diff --git a/keras/mixed_precision/device_compatibility_check.py b/tf_keras/mixed_precision/device_compatibility_check.py similarity index 100% rename from keras/mixed_precision/device_compatibility_check.py rename to tf_keras/mixed_precision/device_compatibility_check.py diff --git a/keras/mixed_precision/device_compatibility_check_test.py b/tf_keras/mixed_precision/device_compatibility_check_test.py similarity index 98% rename from keras/mixed_precision/device_compatibility_check_test.py rename to tf_keras/mixed_precision/device_compatibility_check_test.py index 9b355e09b..6a6710057 100644 --- a/keras/mixed_precision/device_compatibility_check_test.py +++ b/tf_keras/mixed_precision/device_compatibility_check_test.py @@ -18,8 +18,8 @@ import tensorflow.compat.v2 as tf -from keras.mixed_precision import device_compatibility_check -from keras.testing_infra import test_combinations +from tf_keras.mixed_precision import device_compatibility_check +from tf_keras.testing_infra import test_combinations # isort: off from tensorflow.python.platform import tf_logging diff --git a/keras/mixed_precision/layer_correctness_test.py b/tf_keras/mixed_precision/layer_correctness_test.py similarity index 91% rename from keras/mixed_precision/layer_correctness_test.py rename to tf_keras/mixed_precision/layer_correctness_test.py index 274b4e186..11da18539 100644 --- a/keras/mixed_precision/layer_correctness_test.py +++ b/tf_keras/mixed_precision/layer_correctness_test.py @@ -18,32 +18,32 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import layers -from keras import models -from keras.layers import activation -from keras.layers import attention -from keras.layers import convolutional -from keras.layers import core -from keras.layers import locally_connected -from keras.layers import merging -from keras.layers import pooling -from keras.layers import regularization -from keras.layers import reshaping -from keras.layers.normalization import batch_normalization -from keras.layers.normalization import layer_normalization -from keras.layers.preprocessing import image_preprocessing -from keras.layers.preprocessing import normalization -from keras.layers.rnn import bidirectional -from keras.layers.rnn import conv_lstm2d -from keras.layers.rnn import gru -from keras.layers.rnn import gru_v1 -from keras.layers.rnn import lstm -from keras.layers.rnn import lstm_v1 -from keras.layers.rnn import simple_rnn -from keras.layers.rnn import time_distributed -from keras.mixed_precision import policy -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras import layers +from tf_keras import models +from tf_keras.layers import activation +from tf_keras.layers import attention +from tf_keras.layers import convolutional +from tf_keras.layers import core +from tf_keras.layers import locally_connected +from tf_keras.layers import merging +from tf_keras.layers import pooling +from tf_keras.layers import regularization +from tf_keras.layers import reshaping +from tf_keras.layers.normalization import batch_normalization +from tf_keras.layers.normalization import layer_normalization +from tf_keras.layers.preprocessing import image_preprocessing +from tf_keras.layers.preprocessing import normalization +from tf_keras.layers.rnn import bidirectional +from tf_keras.layers.rnn import conv_lstm2d +from tf_keras.layers.rnn import gru +from tf_keras.layers.rnn import gru_v1 +from tf_keras.layers.rnn import lstm +from tf_keras.layers.rnn import lstm_v1 +from tf_keras.layers.rnn import simple_rnn +from tf_keras.layers.rnn import time_distributed +from tf_keras.mixed_precision import policy +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils def create_mirrored_strategy(): diff --git a/keras/mixed_precision/layer_test.py b/tf_keras/mixed_precision/layer_test.py similarity index 97% rename from keras/mixed_precision/layer_test.py rename to tf_keras/mixed_precision/layer_test.py index b45133d0a..16f070b12 100644 --- a/keras/mixed_precision/layer_test.py +++ b/tf_keras/mixed_precision/layer_test.py @@ -20,15 +20,15 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import layers -from keras import models -from keras.engine import base_layer -from keras.engine import base_layer_utils -from keras.engine import input_spec -from keras.mixed_precision import policy -from keras.mixed_precision import test_util as mp_test_util -from keras.optimizers.legacy import gradient_descent -from keras.testing_infra import test_combinations +from tf_keras import layers +from tf_keras import models +from tf_keras.engine import base_layer +from tf_keras.engine import base_layer_utils +from tf_keras.engine import input_spec +from tf_keras.mixed_precision import policy +from tf_keras.mixed_precision import test_util as mp_test_util +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.testing_infra import test_combinations class MultiplyLayerWithFunction(mp_test_util.MultiplyLayer): @@ -72,7 +72,7 @@ def create_central_storage_strategy(): @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) class LayerTest(test_combinations.TestCase): - """Test mixed precision with Keras layers.""" + """Test mixed precision with TF-Keras layers.""" @parameterized.named_parameters(*TESTCASES) def test_mixed_policies_(self, strategy_fn): @@ -355,7 +355,7 @@ def test_config(self, strategy_fn): @parameterized.named_parameters(*TESTCASES) def test_from_config_policy_v1(self, strategy_fn): - # Test that layers serialized in previous Keras versions with the + # Test that layers serialized in previous TF-Keras versions with the # now-deleted PolicyV1 can be deserialized. In such cases, the PolicyV1 # will be converted to a Policy, since PolicyV1 no longer exists. Unlike # Policy, PolicyV1 had a "loss_scale" field, which is silently dropped diff --git a/keras/mixed_precision/loss_scale_optimizer.py b/tf_keras/mixed_precision/loss_scale_optimizer.py similarity index 98% rename from keras/mixed_precision/loss_scale_optimizer.py rename to tf_keras/mixed_precision/loss_scale_optimizer.py index 4ea1b5d8d..fcb3e44d0 100644 --- a/keras/mixed_precision/loss_scale_optimizer.py +++ b/tf_keras/mixed_precision/loss_scale_optimizer.py @@ -16,13 +16,13 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras import optimizers -from keras.dtensor import utils as dtensor_utils -from keras.optimizers import optimizer -from keras.optimizers import utils as optimizer_utils -from keras.optimizers.legacy import optimizer_v2 -from keras.saving import serialization_lib +from tf_keras import backend +from tf_keras import optimizers +from tf_keras.dtensor import utils as dtensor_utils +from tf_keras.optimizers import optimizer +from tf_keras.optimizers import utils as optimizer_utils +from tf_keras.optimizers.legacy import optimizer_v2 +from tf_keras.saving import serialization_lib # isort: off from tensorflow.python.platform import tf_logging @@ -110,7 +110,7 @@ def _maybe_warn_about_scaling( "LossScaleOptimizer.apply_gradients(). This will likely result in " "worse model quality, so please call them in the correct places! " f"For example:{example_code}\nFor more information, see " - "https://www.tensorflow.org/api_docs/python/tf/keras/mixed_precision/LossScaleOptimizer" # noqa: E501 + "https://www.tensorflow.org/api_docs/python/tf/tf_keras/mixed_precision/LossScaleOptimizer" # noqa: E501 ) elif not loss_has_been_scaled: tf_logging.warning( @@ -120,7 +120,7 @@ def _maybe_warn_about_scaling( "worse model quality, so please call get_scaled_loss() in the " f"correct place! For example:{example_code}\nFor more information, " "see " - "https://www.tensorflow.org/api_docs/python/tf/keras/mixed_precision/LossScaleOptimizer" # noqa: E501 + "https://www.tensorflow.org/api_docs/python/tf/tf_keras/mixed_precision/LossScaleOptimizer" # noqa: E501 ) elif not gradients_have_been_unscaled: tf_logging.warning( @@ -130,7 +130,7 @@ def _maybe_warn_about_scaling( "model quality, so please call get_unscaled_gradients() in the " f"correct place! For example:{example_code}\nFor more information, " "see " - "https://www.tensorflow.org/api_docs/python/tf/keras/mixed_precision/LossScaleOptimizer" # noqa: E501 + "https://www.tensorflow.org/api_docs/python/tf/tf_keras/mixed_precision/LossScaleOptimizer" # noqa: E501 ) @@ -404,7 +404,7 @@ class BaseLossScaleOptimizer(metaclass=LossScaleOptimizerMetaclass): When mixed precision with float16 is used, there is typically no risk of underflow affecting model quality if loss scaling is properly used. See [the mixed precision guide]( - https://www.tensorflow.org/guide/keras/mixed_precision) for more information + https://www.tensorflow.org/guide/tf_keras/mixed_precision) for more information on how to use mixed precision. Args: @@ -1122,7 +1122,7 @@ def __init__( "You passed a `tf.keras.optimizers.Optimizer` instance to " "LossScaleOptimizerV3, but only the new experimental " "optimizer defined in " - "keras/optimizer_expeirmental/optimizer.py can be " + "tf_keras/optimizer_expeirmental/optimizer.py can be " "passed. Please use " "`tf.keras.mixed_precision.LossScaleOptimizer` " "instead of LossScaleOptimizerV3, as the former supports " @@ -1491,7 +1491,7 @@ def _create_loss_scale_optimizer_from_v1_loss_scale(optimizer, loss_scale): `tf.__internal__.mixed_precision.register_loss_scale_wrapper` below, which is called so that `tf.compat.v1.mixed_precision.enable_mixed_precision_graph_rewrite` can - wrap a Keras optimizer with a LossScaleOptimizer. + wrap a TF-Keras optimizer with a LossScaleOptimizer. Args: optimizer: An OptimizerV2 instance. diff --git a/keras/mixed_precision/loss_scale_optimizer_test.py b/tf_keras/mixed_precision/loss_scale_optimizer_test.py similarity index 98% rename from keras/mixed_precision/loss_scale_optimizer_test.py rename to tf_keras/mixed_precision/loss_scale_optimizer_test.py index e7c2885bc..f783b4b24 100644 --- a/keras/mixed_precision/loss_scale_optimizer_test.py +++ b/tf_keras/mixed_precision/loss_scale_optimizer_test.py @@ -21,18 +21,18 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import optimizers -from keras.mixed_precision import loss_scale_optimizer -from keras.mixed_precision import test_util as mp_test_util -from keras.optimizers import adam as adam_experimental -from keras.optimizers import optimizer as optimizer_experimental -from keras.optimizers import sgd as sgd_experimental -from keras.optimizers.legacy import adam -from keras.optimizers.legacy import gradient_descent -from keras.optimizers.legacy import optimizer_v2 -from keras.optimizers.schedules import learning_rate_schedule -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras import optimizers +from tf_keras.mixed_precision import loss_scale_optimizer +from tf_keras.mixed_precision import test_util as mp_test_util +from tf_keras.optimizers import adam as adam_experimental +from tf_keras.optimizers import optimizer as optimizer_experimental +from tf_keras.optimizers import sgd as sgd_experimental +from tf_keras.optimizers.legacy import adam +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.optimizers.legacy import optimizer_v2 +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/mixed_precision/mixed_precision_graph_rewrite_test.py b/tf_keras/mixed_precision/mixed_precision_graph_rewrite_test.py similarity index 94% rename from keras/mixed_precision/mixed_precision_graph_rewrite_test.py rename to tf_keras/mixed_precision/mixed_precision_graph_rewrite_test.py index 6f8523393..34c1e6834 100644 --- a/keras/mixed_precision/mixed_precision_graph_rewrite_test.py +++ b/tf_keras/mixed_precision/mixed_precision_graph_rewrite_test.py @@ -12,19 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests Keras integration with enable_mixed_precision_graph_rewrite().""" +"""Tests TF-Keras integration with enable_mixed_precision_graph_rewrite().""" import os import tensorflow.compat.v2 as tf -from keras.mixed_precision import ( +from tf_keras.mixed_precision import ( loss_scale_optimizer as loss_scale_optimizer_v2, ) -from keras.mixed_precision import policy -from keras.optimizers.legacy import gradient_descent as gradient_descent_v2 -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras.mixed_precision import policy +from tf_keras.optimizers.legacy import gradient_descent as gradient_descent_v2 +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class MixedPrecisionTest(test_combinations.TestCase): @@ -160,7 +160,7 @@ def test_optimizer_errors(self): def test_error_if_policy_is_set(self): with policy.policy_scope("mixed_float16"): with self.assertRaisesRegex( - ValueError, "the global Keras dtype Policy has been set" + ValueError, "the global TF-Keras dtype Policy has been set" ): tf.compat.v1.mixed_precision.enable_mixed_precision_graph_rewrite( # noqa: E501 gradient_descent_v2.SGD(1.0) diff --git a/keras/mixed_precision/model_test.py b/tf_keras/mixed_precision/model_test.py similarity index 96% rename from keras/mixed_precision/model_test.py rename to tf_keras/mixed_precision/model_test.py index 0663d589f..c251f5ada 100644 --- a/keras/mixed_precision/model_test.py +++ b/tf_keras/mixed_precision/model_test.py @@ -21,33 +21,33 @@ from absl import flags from absl.testing import parameterized -from keras import backend -from keras import layers -from keras import models -from keras.applications import densenet -from keras.applications import efficientnet -from keras.applications import inception_resnet_v2 -from keras.applications import inception_v3 -from keras.applications import mobilenet -from keras.applications import nasnet -from keras.applications import resnet -from keras.applications import vgg16 -from keras.applications import xception -from keras.engine import base_layer_utils -from keras.engine import input_spec -from keras.engine import sequential -from keras.layers import core -from keras.mixed_precision import loss_scale_optimizer -from keras.mixed_precision import policy -from keras.mixed_precision import test_util as mp_test_util -from keras.optimizers import optimizer_v1 -from keras.optimizers import sgd -from keras.optimizers.legacy import gradient_descent -from keras.saving import object_registration -from keras.saving.legacy import save -from keras.saving.serialization_lib import SafeModeScope -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras import backend +from tf_keras import layers +from tf_keras import models +from tf_keras.applications import densenet +from tf_keras.applications import efficientnet +from tf_keras.applications import inception_resnet_v2 +from tf_keras.applications import inception_v3 +from tf_keras.applications import mobilenet +from tf_keras.applications import nasnet +from tf_keras.applications import resnet +from tf_keras.applications import vgg16 +from tf_keras.applications import xception +from tf_keras.engine import base_layer_utils +from tf_keras.engine import input_spec +from tf_keras.engine import sequential +from tf_keras.layers import core +from tf_keras.mixed_precision import loss_scale_optimizer +from tf_keras.mixed_precision import policy +from tf_keras.mixed_precision import test_util as mp_test_util +from tf_keras.optimizers import optimizer_v1 +from tf_keras.optimizers import sgd +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.saving import object_registration +from tf_keras.saving.legacy import save +from tf_keras.saving.serialization_lib import SafeModeScope +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # If called outside any strategy.scope() calls, this will return the default # strategy. @@ -69,7 +69,7 @@ def create_mirrored_strategy(): class KerasModelTest(test_combinations.TestCase): - """Test mixed precision with Keras models.""" + """Test mixed precision with TF-Keras models.""" def _skip_if_strategy_unsupported(self, strategy_fn): if ( @@ -866,11 +866,11 @@ def test_restore_old_loss_scale_checkpoint(self): # testdata/BUILD. ckpt_dir = os.path.join( flags.FLAGS["test_srcdir"].value, - "org_keras/keras", + "org_keras/tf_keras", "mixed_precision/testdata/lso_ckpt_tf2.2", ) # ckpt_dir = test.test_src_dir_path( - # 'python/keras/mixed_precision/testdata/lso_ckpt_tf2.2') + # 'python/tf_keras/mixed_precision/testdata/lso_ckpt_tf2.2') model.load_weights(os.path.join(ckpt_dir, "ckpt")) model.compile(opt, "mse", run_eagerly=test_utils.should_run_eagerly()) model(np.zeros((2, 2))) # Create model weights @@ -907,12 +907,9 @@ def test_restore_old_loss_scale_checkpoint(self): def test_restore_old_saved_model(self): saved_model_dir = os.path.join( flags.FLAGS["test_srcdir"].value, - "org_keras/keras", + "org_keras/tf_keras", "mixed_precision/testdata/lso_savedmodel_tf2.2", ) - # saved_model_dir = test.test_src_dir_path( - # 'python/keras/mixed_precision/testdata/' - # 'lso_savedmodel_tf2.2') model = save.load_model(saved_model_dir) expected_kernel = np.array( [[9.229685, 10.901115], [10.370763, 9.757362]] diff --git a/keras/mixed_precision/policy.py b/tf_keras/mixed_precision/policy.py similarity index 98% rename from keras/mixed_precision/policy.py rename to tf_keras/mixed_precision/policy.py index faaf9377e..e2c85a958 100644 --- a/keras/mixed_precision/policy.py +++ b/tf_keras/mixed_precision/policy.py @@ -18,11 +18,11 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer_utils -from keras.mixed_precision import device_compatibility_check -from keras.mixed_precision import loss_scale_optimizer -from keras.saving import serialization_lib +from tf_keras import backend +from tf_keras.engine import base_layer_utils +from tf_keras.mixed_precision import device_compatibility_check +from tf_keras.mixed_precision import loss_scale_optimizer +from tf_keras.saving import serialization_lib # isort: off from tensorflow.python.util.tf_export import keras_export @@ -30,7 +30,7 @@ @keras_export("keras.mixed_precision.Policy", v1=[]) class Policy: - """A dtype policy for a Keras layer. + """A dtype policy for a TF-Keras layer. A dtype policy determines a layer's computation and variable dtypes. Each layer has a policy. Policies can be passed to the `dtype` argument of layer @@ -50,7 +50,7 @@ class Policy: API name. Mixed precision can be enabled by passing `'mixed_float16'` or `'mixed_bfloat16'` to `tf.keras.mixed_precision.set_global_policy`. See [the mixed precision - guide](https://www.tensorflow.org/guide/keras/mixed_precision) for more + guide](https://www.tensorflow.org/guide/tf_keras/mixed_precision) for more information on how to use mixed precision. >>> tf.keras.mixed_precision.set_global_policy('mixed_float16') @@ -533,7 +533,7 @@ def _policy_equivalent_to_dtype(policy): def serialize(policy): if _policy_equivalent_to_dtype(policy): # We return either None or the policy name for compatibility with older - # versions of Keras. If the policy name is returned, it is a dtype + # versions of TF-Keras. If the policy name is returned, it is a dtype # string such as 'float32'. return None if policy.name == "_infer" else policy.name return serialization_lib.serialize_keras_object(policy) diff --git a/keras/mixed_precision/policy_test.py b/tf_keras/mixed_precision/policy_test.py similarity index 97% rename from keras/mixed_precision/policy_test.py rename to tf_keras/mixed_precision/policy_test.py index 5131ce085..c56d71001 100644 --- a/keras/mixed_precision/policy_test.py +++ b/tf_keras/mixed_precision/policy_test.py @@ -17,12 +17,12 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.engine import base_layer_utils -from keras.mixed_precision import device_compatibility_check -from keras.mixed_precision import policy as mp_policy -from keras.optimizers.legacy import gradient_descent -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras.engine import base_layer_utils +from tf_keras.mixed_precision import device_compatibility_check +from tf_keras.mixed_precision import policy as mp_policy +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.platform import tf_logging diff --git a/keras/mixed_precision/test_util.py b/tf_keras/mixed_precision/test_util.py similarity index 97% rename from keras/mixed_precision/test_util.py rename to tf_keras/mixed_precision/test_util.py index 43c422189..96b8ef335 100644 --- a/keras/mixed_precision/test_util.py +++ b/tf_keras/mixed_precision/test_util.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras import regularizers -from keras.engine import base_layer +from tf_keras import regularizers +from tf_keras.engine import base_layer def create_identity_with_grad_check_fn(expected_gradient, expected_dtype=None): @@ -64,7 +64,7 @@ def grad(dx): return x, grad - # Keras sometimes has trouble serializing Lambda layers with a decorated + # TF-Keras sometimes has trouble serializing Lambda layers with a decorated # function. So we define and return a non-decorated function. def identity_with_grad_check(x): return _identity_with_grad_check(x) @@ -101,7 +101,7 @@ def grad(dx): return x, grad - # Keras sometimes has trouble serializing Lambda layers with a decorated + # TF-Keras sometimes has trouble serializing Lambda layers with a decorated # function. So we define and return a non-decorated function. def identity_with_nan_gradients(x): return _identity_with_nan_gradients(x) diff --git a/keras/mixed_precision/testdata/BUILD b/tf_keras/mixed_precision/testdata/BUILD similarity index 89% rename from keras/mixed_precision/testdata/BUILD rename to tf_keras/mixed_precision/testdata/BUILD index cd79ce6cd..14bf961c1 100644 --- a/keras/mixed_precision/testdata/BUILD +++ b/tf_keras/mixed_precision/testdata/BUILD @@ -2,8 +2,8 @@ # Contains checkpoints and SavedModels for testing purposes. package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], - default_visibility = ["//keras:friends"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], + default_visibility = ["//tf_keras:friends"], licenses = ["notice"], ) diff --git a/keras/mixed_precision/testdata/lso_ckpt_tf2.2/checkpoint b/tf_keras/mixed_precision/testdata/lso_ckpt_tf2.2/checkpoint similarity index 100% rename from keras/mixed_precision/testdata/lso_ckpt_tf2.2/checkpoint rename to tf_keras/mixed_precision/testdata/lso_ckpt_tf2.2/checkpoint diff --git a/keras/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.data-00000-of-00002 b/tf_keras/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.data-00000-of-00002 similarity index 100% rename from keras/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.data-00000-of-00002 rename to tf_keras/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.data-00000-of-00002 diff --git a/keras/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.data-00001-of-00002 b/tf_keras/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.data-00001-of-00002 similarity index 100% rename from keras/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.data-00001-of-00002 rename to tf_keras/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.data-00001-of-00002 diff --git a/keras/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.index b/tf_keras/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.index similarity index 100% rename from keras/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.index rename to tf_keras/mixed_precision/testdata/lso_ckpt_tf2.2/ckpt.index diff --git a/keras/mixed_precision/testdata/lso_savedmodel_tf2.2/saved_model.pb b/tf_keras/mixed_precision/testdata/lso_savedmodel_tf2.2/saved_model.pb similarity index 100% rename from keras/mixed_precision/testdata/lso_savedmodel_tf2.2/saved_model.pb rename to tf_keras/mixed_precision/testdata/lso_savedmodel_tf2.2/saved_model.pb diff --git a/keras/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.data-00000-of-00002 b/tf_keras/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.data-00000-of-00002 similarity index 100% rename from keras/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.data-00000-of-00002 rename to tf_keras/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.data-00000-of-00002 diff --git a/keras/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.data-00001-of-00002 b/tf_keras/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.data-00001-of-00002 similarity index 100% rename from keras/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.data-00001-of-00002 rename to tf_keras/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.data-00001-of-00002 diff --git a/keras/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.index b/tf_keras/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.index similarity index 100% rename from keras/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.index rename to tf_keras/mixed_precision/testdata/lso_savedmodel_tf2.2/variables/variables.index diff --git a/keras/models/BUILD b/tf_keras/models/BUILD similarity index 60% rename from keras/models/BUILD rename to tf_keras/models/BUILD index 76161b078..3d065365c 100644 --- a/keras/models/BUILD +++ b/tf_keras/models/BUILD @@ -1,13 +1,13 @@ -# Keras models +# TF-Keras models # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "distribute_py_test") -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "distribute_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", ], licenses = ["notice"], ) @@ -19,7 +19,7 @@ py_library( deps = [ ":cloning", "//:expect_tensorflow_installed", - "//keras/engine:data_adapter", + "//tf_keras/engine:data_adapter", ], ) @@ -43,14 +43,14 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine", - "//keras/engine:base_layer", - "//keras/metrics", - "//keras/optimizers", - "//keras/saving", - "//keras/utils:generic_utils", - "//keras/utils:version_utils", + "//tf_keras:backend", + "//tf_keras/engine", + "//tf_keras/engine:base_layer", + "//tf_keras/metrics", + "//tf_keras/optimizers", + "//tf_keras/saving", + "//tf_keras/utils:generic_utils", + "//tf_keras/utils:version_utils", ], ) @@ -65,11 +65,11 @@ tf_py_test( "notsan", # b/67509773 ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -85,10 +85,10 @@ distribute_py_test( ], deps = [ ":sharpness_aware_minimization", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/optimizers", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/optimizers", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/tf_keras/models/__init__.py b/tf_keras/models/__init__.py new file mode 100644 index 000000000..c1702b25c --- /dev/null +++ b/tf_keras/models/__init__.py @@ -0,0 +1,36 @@ +# Copyright 2022 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. +# ============================================================================== +"""Keras models API.""" + + +from tf_keras.engine.functional import Functional +from tf_keras.engine.sequential import Sequential +from tf_keras.engine.training import Model + +# Private symbols that are used in tests. +# TODO(b/221261361): Clean up private symbols usage and remove these imports. +from tf_keras.models.cloning import _clone_functional_model +from tf_keras.models.cloning import _clone_layer +from tf_keras.models.cloning import _clone_layers_and_model_config +from tf_keras.models.cloning import _clone_sequential_model +from tf_keras.models.cloning import clone_and_build_model +from tf_keras.models.cloning import clone_model +from tf_keras.models.cloning import share_weights +from tf_keras.models.sharpness_aware_minimization import SharpnessAwareMinimization +from tf_keras.saving.legacy.model_config import model_from_config +from tf_keras.saving.legacy.model_config import model_from_json +from tf_keras.saving.legacy.model_config import model_from_yaml +from tf_keras.saving.saving_api import load_model +from tf_keras.saving.saving_api import save_model diff --git a/keras/models/cloning.py b/tf_keras/models/cloning.py similarity index 96% rename from keras/models/cloning.py rename to tf_keras/models/cloning.py index 85c5ffd13..5b9a399a6 100644 --- a/keras/models/cloning.py +++ b/tf_keras/models/cloning.py @@ -17,22 +17,22 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras import metrics as metrics_module -from keras.engine import functional -from keras.engine import sequential -from keras.engine import training -from keras.engine import training_v1 -from keras.engine.base_layer import AddMetric -from keras.engine.base_layer import Layer -from keras.engine.input_layer import Input -from keras.engine.input_layer import InputLayer -from keras.optimizers import optimizer_v1 -from keras.saving.legacy import serialization -from keras.saving.legacy.saved_model.utils import keras_option_scope -from keras.saving.object_registration import CustomObjectScope -from keras.utils import generic_utils -from keras.utils import version_utils +from tf_keras import backend +from tf_keras import metrics as metrics_module +from tf_keras.engine import functional +from tf_keras.engine import sequential +from tf_keras.engine import training +from tf_keras.engine import training_v1 +from tf_keras.engine.base_layer import AddMetric +from tf_keras.engine.base_layer import Layer +from tf_keras.engine.input_layer import Input +from tf_keras.engine.input_layer import InputLayer +from tf_keras.optimizers import optimizer_v1 +from tf_keras.saving.legacy import serialization +from tf_keras.saving.legacy.saved_model.utils import keras_option_scope +from tf_keras.saving.object_registration import CustomObjectScope +from tf_keras.utils import generic_utils +from tf_keras.utils import version_utils # isort: off from tensorflow.python.platform import tf_logging as logging @@ -183,13 +183,13 @@ def _clone_functional_model(model, input_tensors=None, layer_fn=_clone_layer): new_input_layers = {} # Cache for created layers. if input_tensors is not None: - # Make sure that all input tensors come from a Keras layer. + # Make sure that all input tensors come from a TF-Keras layer. input_tensors = tf.nest.flatten(input_tensors) for i, input_tensor in enumerate(input_tensors): original_input_layer = model._input_layers[i] # Cache input layer. Create a new layer if the tensor is originally - # not from a Keras layer. + # not from a TF-Keras layer. if not backend.is_keras_tensor(input_tensor): name = original_input_layer.name input_tensor = Input( @@ -308,7 +308,7 @@ def _remove_ancillary_layers(model, layer_map, layers): model outputs, e.g., layers from `add_loss` and `add_metric`. Args: - model: A Keras Model. + model: A TF-Keras Model. layer_map: A map to from layers in the `model` to those in `layers`. layers: A list of all layers. @@ -416,7 +416,7 @@ def _clone_sequential_model(model, input_tensors=None, layer_fn=_clone_layer): else: raise ValueError( "Cannot clone a `Sequential` model on top " - "of a tensor that comes from a Keras layer " + "of a tensor that comes from a TF-Keras layer " "other than an `InputLayer`. " "Use the Functional API instead. " f"Received: input_tensors={input_tensors}" @@ -572,7 +572,7 @@ def _in_place_subclassed_model_reset(model): `_in_place_subclassed_model_state_restoration`. Args: - model: Instance of a Keras model created via subclassing. + model: Instance of a TF-Keras model created via subclassing. Raises: ValueError: In case the model uses a subclassed model as inner layer. @@ -710,7 +710,7 @@ def in_place_subclassed_model_state_restoration(model): called in `clone_and_build_model` if `in_place_reset` is set to True. Args: - model: Instance of a Keras model created via subclassing, on which + model: Instance of a TF-Keras model created via subclassing, on which `_in_place_subclassed_model_reset` was previously called. """ assert not model._is_graph_network @@ -773,7 +773,7 @@ def clone_and_build_model( `in_place_subclassed_model_state_restoration(model)`. optimizer_iterations: An iterations variable that will be incremented by the optimizer if the clone is compiled. This argument is used when a - Keras model is cloned into an Estimator model function, because + TF-Keras model is cloned into an Estimator model function, because Estimators create their own global step variable. optimizer_config: Optimizer config dictionary or list of dictionary returned from `get_config()`. This argument should be defined if diff --git a/keras/models/cloning_test.py b/tf_keras/models/cloning_test.py similarity index 98% rename from keras/models/cloning_test.py rename to tf_keras/models/cloning_test.py index ed79dcaa5..107a8b8e7 100644 --- a/keras/models/cloning_test.py +++ b/tf_keras/models/cloning_test.py @@ -21,13 +21,13 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import backend -from keras import metrics -from keras import models -from keras.optimizers import optimizer_v1 -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras import backend +from tf_keras import metrics +from tf_keras import models +from tf_keras.optimizers import optimizer_v1 +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class TestModel(keras.Model): diff --git a/keras/models/sharpness_aware_minimization.py b/tf_keras/models/sharpness_aware_minimization.py similarity index 96% rename from keras/models/sharpness_aware_minimization.py rename to tf_keras/models/sharpness_aware_minimization.py index 543b76796..70c4c2583 100644 --- a/keras/models/sharpness_aware_minimization.py +++ b/tf_keras/models/sharpness_aware_minimization.py @@ -18,11 +18,11 @@ import tensorflow.compat.v2 as tf -from keras.engine import data_adapter -from keras.layers import deserialize as deserialize_layer -from keras.models import Model -from keras.saving.object_registration import register_keras_serializable -from keras.saving.serialization_lib import serialize_keras_object +from tf_keras.engine import data_adapter +from tf_keras.layers import deserialize as deserialize_layer +from tf_keras.models import Model +from tf_keras.saving.object_registration import register_keras_serializable +from tf_keras.saving.serialization_lib import serialize_keras_object # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/models/sharpness_aware_minimization_test.py b/tf_keras/models/sharpness_aware_minimization_test.py similarity index 96% rename from keras/models/sharpness_aware_minimization_test.py rename to tf_keras/models/sharpness_aware_minimization_test.py index 7571f179b..23d9cff6f 100644 --- a/keras/models/sharpness_aware_minimization_test.py +++ b/tf_keras/models/sharpness_aware_minimization_test.py @@ -5,10 +5,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.models import sharpness_aware_minimization -from keras.optimizers import adam -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.models import sharpness_aware_minimization +from tf_keras.optimizers import adam +from tf_keras.testing_infra import test_utils ds_combinations = tf.__internal__.distribute.combinations diff --git a/tf_keras/opensource_only.files b/tf_keras/opensource_only.files new file mode 100644 index 000000000..85f4ecd8e --- /dev/null +++ b/tf_keras/opensource_only.files @@ -0,0 +1,3 @@ +tf_keras/api/tests/API_UPDATE_WARNING.txt: +tf_keras/api/tests/README.txt: +tf_keras/benchmarks/layer_benchmarks/run_xprof.py: diff --git a/keras/optimizers/BUILD b/tf_keras/optimizers/BUILD similarity index 70% rename from keras/optimizers/BUILD rename to tf_keras/optimizers/BUILD index f496373fe..bb762a7c9 100644 --- a/keras/optimizers/BUILD +++ b/tf_keras/optimizers/BUILD @@ -1,17 +1,17 @@ # Description: -# Contains the Keras Optimizer API. +# Contains the TF-Keras Optimizer API. # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "tf_py_test") -load("@org_keras//keras:keras.bzl", "distribute_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "distribute_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/tensorflow/python:__pkg__", "//third_party/tensorflow/python/distribute:__pkg__", "//third_party/tensorflow/python/saved_model:__pkg__", # For unit tests. @@ -43,11 +43,11 @@ py_library( deps = [ ":utils", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/dtensor:utils", - "//keras/optimizers/legacy:optimizers", - "//keras/optimizers/schedules:learning_rate_schedule", - "//keras/utils:engine_utils", + "//tf_keras:backend", + "//tf_keras/dtensor:utils", + "//tf_keras/optimizers/legacy:optimizers", + "//tf_keras/optimizers/schedules:learning_rate_schedule", + "//tf_keras/utils:engine_utils", ], ) @@ -66,7 +66,7 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/optimizers/schedules:learning_rate_schedule", + "//tf_keras/optimizers/schedules:learning_rate_schedule", ], ) @@ -78,11 +78,11 @@ tf_py_test( shard_count = 8, tags = ["notsan"], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -93,8 +93,8 @@ cuda_py_test( deps = [ ":legacy_learning_rate_decay", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -112,10 +112,10 @@ distribute_py_test( ], deps = [ ":optimizers", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -131,10 +131,10 @@ distribute_py_test( ], deps = [ ":optimizers", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -146,6 +146,6 @@ cuda_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) diff --git a/keras/optimizers/__init__.py b/tf_keras/optimizers/__init__.py similarity index 82% rename from keras/optimizers/__init__.py rename to tf_keras/optimizers/__init__.py index 39a026699..c338db175 100644 --- a/keras/optimizers/__init__.py +++ b/tf_keras/optimizers/__init__.py @@ -25,45 +25,45 @@ import tensorflow.compat.v2 as tf from absl import logging -from keras import backend -from keras.optimizers import adadelta -from keras.optimizers import adafactor -from keras.optimizers import adagrad -from keras.optimizers import adam -from keras.optimizers import adamax -from keras.optimizers import adamw -from keras.optimizers import ftrl -from keras.optimizers import lion -from keras.optimizers import nadam -from keras.optimizers import optimizer as base_optimizer -from keras.optimizers import rmsprop -from keras.optimizers import sgd -from keras.optimizers.legacy import adadelta as adadelta_legacy -from keras.optimizers.legacy import adagrad as adagrad_legacy -from keras.optimizers.legacy import adam as adam_legacy -from keras.optimizers.legacy import adamax as adamax_legacy -from keras.optimizers.legacy import ftrl as ftrl_legacy -from keras.optimizers.legacy import gradient_descent as gradient_descent_legacy -from keras.optimizers.legacy import nadam as nadam_legacy -from keras.optimizers.legacy import optimizer_v2 as base_optimizer_legacy -from keras.optimizers.legacy import rmsprop as rmsprop_legacy -from keras.optimizers.legacy.adadelta import Adadelta -from keras.optimizers.legacy.adagrad import Adagrad -from keras.optimizers.legacy.adam import Adam -from keras.optimizers.legacy.adamax import Adamax -from keras.optimizers.legacy.ftrl import Ftrl +from tf_keras import backend +from tf_keras.optimizers import adadelta +from tf_keras.optimizers import adafactor +from tf_keras.optimizers import adagrad +from tf_keras.optimizers import adam +from tf_keras.optimizers import adamax +from tf_keras.optimizers import adamw +from tf_keras.optimizers import ftrl +from tf_keras.optimizers import lion +from tf_keras.optimizers import nadam +from tf_keras.optimizers import optimizer as base_optimizer +from tf_keras.optimizers import rmsprop +from tf_keras.optimizers import sgd +from tf_keras.optimizers.legacy import adadelta as adadelta_legacy +from tf_keras.optimizers.legacy import adagrad as adagrad_legacy +from tf_keras.optimizers.legacy import adam as adam_legacy +from tf_keras.optimizers.legacy import adamax as adamax_legacy +from tf_keras.optimizers.legacy import ftrl as ftrl_legacy +from tf_keras.optimizers.legacy import gradient_descent as gradient_descent_legacy +from tf_keras.optimizers.legacy import nadam as nadam_legacy +from tf_keras.optimizers.legacy import optimizer_v2 as base_optimizer_legacy +from tf_keras.optimizers.legacy import rmsprop as rmsprop_legacy +from tf_keras.optimizers.legacy.adadelta import Adadelta +from tf_keras.optimizers.legacy.adagrad import Adagrad +from tf_keras.optimizers.legacy.adam import Adam +from tf_keras.optimizers.legacy.adamax import Adamax +from tf_keras.optimizers.legacy.ftrl import Ftrl # Symbols to be accessed under keras.optimizers. To be replaced with # optimizers v2022 when they graduate out of experimental. -from keras.optimizers.legacy.gradient_descent import SGD -from keras.optimizers.legacy.nadam import Nadam -from keras.optimizers.legacy.rmsprop import RMSprop -from keras.optimizers.optimizer_v1 import Optimizer -from keras.optimizers.optimizer_v1 import TFOptimizer -from keras.optimizers.schedules import learning_rate_schedule -from keras.saving.legacy import serialization as legacy_serialization -from keras.saving.serialization_lib import deserialize_keras_object -from keras.saving.serialization_lib import serialize_keras_object +from tf_keras.optimizers.legacy.gradient_descent import SGD +from tf_keras.optimizers.legacy.nadam import Nadam +from tf_keras.optimizers.legacy.rmsprop import RMSprop +from tf_keras.optimizers.optimizer_v1 import Optimizer +from tf_keras.optimizers.optimizer_v1 import TFOptimizer +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.saving.legacy import serialization as legacy_serialization +from tf_keras.saving.serialization_lib import deserialize_keras_object +from tf_keras.saving.serialization_lib import serialize_keras_object # isort: off from tensorflow.python.util.tf_export import keras_export @@ -123,11 +123,11 @@ def deserialize(config, custom_objects=None, use_legacy_format=False, **kwargs): deserialization. Returns: - A Keras Optimizer instance. + A TF-Keras Optimizer instance. """ # loss_scale_optimizer has a direct dependency of optimizer, import here # rather than top to avoid the cyclic dependency. - from keras.mixed_precision import ( + from tf_keras.mixed_precision import ( loss_scale_optimizer, ) @@ -225,7 +225,7 @@ def convert_to_legacy_optimizer(optimizer): """ # loss_scale_optimizer has a direct dependency of optimizer, import here # rather than top to avoid the cyclic dependency. - from keras.mixed_precision import ( + from tf_keras.mixed_precision import ( loss_scale_optimizer, ) @@ -272,16 +272,16 @@ def convert_to_legacy_optimizer(optimizer): @keras_export("keras.optimizers.get") def get(identifier, **kwargs): - """Retrieves a Keras Optimizer instance. + """Retrieves a TF-Keras Optimizer instance. Args: identifier: Optimizer identifier, one of - String: name of an optimizer - - Dictionary: configuration dictionary. - Keras Optimizer instance (it + - Dictionary: configuration dictionary. - TF-Keras Optimizer instance (it will be returned unchanged). - TensorFlow Optimizer instance (it will - be wrapped as a Keras Optimizer). + be wrapped as a TF-Keras Optimizer). Returns: - A Keras Optimizer instance. + A TF-Keras Optimizer instance. Raises: ValueError: If `identifier` cannot be interpreted. diff --git a/keras/optimizers/adadelta.py b/tf_keras/optimizers/adadelta.py similarity index 96% rename from keras/optimizers/adadelta.py rename to tf_keras/optimizers/adadelta.py index a82eb5cdf..98001e144 100644 --- a/keras/optimizers/adadelta.py +++ b/tf_keras/optimizers/adadelta.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras.optimizers import optimizer -from keras.saving.object_registration import register_keras_serializable +from tf_keras.optimizers import optimizer +from tf_keras.saving.object_registration import register_keras_serializable # isort: off from tensorflow.python.util.tf_export import keras_export @@ -44,7 +44,7 @@ class Adadelta(optimizer.Optimizer): past gradients. This way, Adadelta continues learning even when many updates have been done. Compared to Adagrad, in the original version of Adadelta you don't have to set an initial learning rate. In this version, the initial - learning rate can be set, as in most other Keras optimizers. + learning rate can be set, as in most other TF-Keras optimizers. Args: learning_rate: Initial value for the learning rate: either a floating diff --git a/keras/optimizers/adafactor.py b/tf_keras/optimizers/adafactor.py similarity index 97% rename from keras/optimizers/adafactor.py rename to tf_keras/optimizers/adafactor.py index fb93bdac3..b66c6c5e4 100644 --- a/keras/optimizers/adafactor.py +++ b/tf_keras/optimizers/adafactor.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -from keras.optimizers import optimizer -from keras.optimizers.schedules import learning_rate_schedule -from keras.saving.object_registration import register_keras_serializable +from tf_keras.optimizers import optimizer +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.saving.object_registration import register_keras_serializable # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/optimizers/adagrad.py b/tf_keras/optimizers/adagrad.py similarity index 97% rename from keras/optimizers/adagrad.py rename to tf_keras/optimizers/adagrad.py index 0840d492e..773171e2d 100644 --- a/keras/optimizers/adagrad.py +++ b/tf_keras/optimizers/adagrad.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -from keras import initializers -from keras.optimizers import optimizer -from keras.saving.object_registration import register_keras_serializable +from tf_keras import initializers +from tf_keras.optimizers import optimizer +from tf_keras.saving.object_registration import register_keras_serializable # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/optimizers/adam.py b/tf_keras/optimizers/adam.py similarity index 98% rename from keras/optimizers/adam.py rename to tf_keras/optimizers/adam.py index e17b10fa8..e1971c335 100644 --- a/keras/optimizers/adam.py +++ b/tf_keras/optimizers/adam.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras.optimizers import optimizer -from keras.saving.object_registration import register_keras_serializable +from tf_keras.optimizers import optimizer +from tf_keras.saving.object_registration import register_keras_serializable # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/optimizers/adamax.py b/tf_keras/optimizers/adamax.py similarity index 98% rename from keras/optimizers/adamax.py rename to tf_keras/optimizers/adamax.py index 9b542ee57..6b4261180 100644 --- a/keras/optimizers/adamax.py +++ b/tf_keras/optimizers/adamax.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras.optimizers import optimizer -from keras.saving.object_registration import register_keras_serializable +from tf_keras.optimizers import optimizer +from tf_keras.saving.object_registration import register_keras_serializable # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/optimizers/adamw.py b/tf_keras/optimizers/adamw.py similarity index 98% rename from keras/optimizers/adamw.py rename to tf_keras/optimizers/adamw.py index 8ae5195b5..fa59ee0bd 100644 --- a/keras/optimizers/adamw.py +++ b/tf_keras/optimizers/adamw.py @@ -17,8 +17,8 @@ import tensorflow.compat.v2 as tf -from keras.optimizers import optimizer -from keras.saving.object_registration import register_keras_serializable +from tf_keras.optimizers import optimizer +from tf_keras.saving.object_registration import register_keras_serializable # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/optimizers/ftrl.py b/tf_keras/optimizers/ftrl.py similarity index 98% rename from keras/optimizers/ftrl.py rename to tf_keras/optimizers/ftrl.py index 30f4db99c..a20fad248 100644 --- a/keras/optimizers/ftrl.py +++ b/tf_keras/optimizers/ftrl.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras.optimizers import optimizer -from keras.saving.object_registration import register_keras_serializable +from tf_keras.optimizers import optimizer +from tf_keras.saving.object_registration import register_keras_serializable # isort: off from tensorflow.python.util.tf_export import keras_export @@ -35,7 +35,7 @@ class Ftrl(optimizer.Optimizer): is most suitable for shallow models with large and sparse feature spaces. The algorithm is described by [McMahan et al., 2013](https://research.google.com/pubs/archive/41159.pdf). - The Keras version has support for both online L2 regularization + The TF-Keras version has support for both online L2 regularization (the L2 regularization described in the paper above) and shrinkage-type L2 regularization (which is the addition of an L2 penalty to the loss function). diff --git a/keras/optimizers/legacy/BUILD b/tf_keras/optimizers/legacy/BUILD similarity index 72% rename from keras/optimizers/legacy/BUILD rename to tf_keras/optimizers/legacy/BUILD index ee714565e..5825c70b0 100644 --- a/keras/optimizers/legacy/BUILD +++ b/tf_keras/optimizers/legacy/BUILD @@ -1,14 +1,14 @@ # Description: -# Contains the Keras OptimizerV2 API (internal TensorFlow version). +# Contains the TF-Keras OptimizerV2 API (internal TensorFlow version). # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], # TODO(scottzhu): Remove non-keras deps from TF. default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/tensorflow/cc/saved_model:__pkg__", # For unit tests. "//third_party/tensorflow/python/trackable:__pkg__", ], @@ -31,14 +31,14 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras:backend_config", - "//keras/engine:base_layer_utils", - "//keras/initializers", - "//keras/optimizers:utils", - "//keras/optimizers/schedules:learning_rate_schedule", - "//keras/utils:layer_utils", - "//keras/utils:tf_utils", + "//tf_keras:backend", + "//tf_keras:backend_config", + "//tf_keras/engine:base_layer_utils", + "//tf_keras/initializers", + "//tf_keras/optimizers:utils", + "//tf_keras/optimizers/schedules:learning_rate_schedule", + "//tf_keras/utils:layer_utils", + "//tf_keras/utils:tf_utils", ], ) @@ -50,7 +50,7 @@ cuda_py_test( deps = [ ":optimizers", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -66,7 +66,7 @@ cuda_py_test( deps = [ ":optimizers", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -80,7 +80,7 @@ cuda_py_test( deps = [ ":optimizers", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -93,7 +93,7 @@ cuda_py_test( deps = [ ":optimizers", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -116,7 +116,7 @@ cuda_py_test( deps = [ ":optimizers", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -141,10 +141,10 @@ cuda_py_test( ], deps = [ ":optimizers", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -156,8 +156,8 @@ cuda_py_test( # TODO(b/168527439): invalid resource variable reference on GPU for TFRT. deps = [ ":optimizers", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/keras/optimizers/legacy/__init__.py b/tf_keras/optimizers/legacy/__init__.py similarity index 100% rename from keras/optimizers/legacy/__init__.py rename to tf_keras/optimizers/legacy/__init__.py diff --git a/keras/optimizers/legacy/adadelta.py b/tf_keras/optimizers/legacy/adadelta.py similarity index 96% rename from keras/optimizers/legacy/adadelta.py rename to tf_keras/optimizers/legacy/adadelta.py index 9310a9bfc..504ffe93c 100644 --- a/keras/optimizers/legacy/adadelta.py +++ b/tf_keras/optimizers/legacy/adadelta.py @@ -17,8 +17,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend_config -from keras.optimizers.legacy import optimizer_v2 +from tf_keras import backend_config +from tf_keras.optimizers.legacy import optimizer_v2 # isort: off from tensorflow.python.util.tf_export import keras_export @@ -42,7 +42,7 @@ class Adadelta(optimizer_v2.OptimizerV2): past gradients. This way, Adadelta continues learning even when many updates have been done. Compared to Adagrad, in the original version of Adadelta you don't have to set an initial learning rate. In this version, the initial - learning rate can be set, as in most other Keras optimizers. + learning rate can be set, as in most other TF-Keras optimizers. Args: learning_rate: Initial value for the learning rate: @@ -103,7 +103,7 @@ def _prepare_local(self, var_device, var_dtype, apply_state): def set_weights(self, weights): params = self.weights - # Override set_weights for backward compatibility of Keras V1 optimizer + # Override set_weights for backward compatibility of TF-Keras V1 optimizer # since it does not include iteration at head of the weight list. Set # iteration to 0. if len(params) == len(weights) + 1: diff --git a/keras/optimizers/legacy/adadelta_test.py b/tf_keras/optimizers/legacy/adadelta_test.py similarity index 98% rename from keras/optimizers/legacy/adadelta_test.py rename to tf_keras/optimizers/legacy/adadelta_test.py index b9d8937b2..2916c7116 100644 --- a/keras/optimizers/legacy/adadelta_test.py +++ b/tf_keras/optimizers/legacy/adadelta_test.py @@ -18,8 +18,8 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.optimizers.legacy import adadelta -from keras.testing_infra import test_combinations +from tf_keras.optimizers.legacy import adadelta +from tf_keras.testing_infra import test_combinations _DATA_TYPES = [tf.half, tf.float32, tf.float64, tf.complex64, tf.complex128] diff --git a/keras/optimizers/legacy/adagrad.py b/tf_keras/optimizers/legacy/adagrad.py similarity index 97% rename from keras/optimizers/legacy/adagrad.py rename to tf_keras/optimizers/legacy/adagrad.py index 4b1300514..db5d14345 100644 --- a/keras/optimizers/legacy/adagrad.py +++ b/tf_keras/optimizers/legacy/adagrad.py @@ -17,8 +17,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend_config -from keras.optimizers.legacy import optimizer_v2 +from tf_keras import backend_config +from tf_keras.optimizers.legacy import optimizer_v2 # isort: off from tensorflow.python.util.tf_export import keras_export @@ -107,7 +107,7 @@ def _prepare_local(self, var_device, var_dtype, apply_state): def set_weights(self, weights): params = self.weights - # Override set_weights for backward compatibility of Keras V1 optimizer + # Override set_weights for backward compatibility of TF-Keras V1 optimizer # since it does not include iteration at head of the weight list. Set # iteration to 0. if len(params) == len(weights) + 1: diff --git a/keras/optimizers/legacy/adagrad_test.py b/tf_keras/optimizers/legacy/adagrad_test.py similarity index 99% rename from keras/optimizers/legacy/adagrad_test.py rename to tf_keras/optimizers/legacy/adagrad_test.py index 221883aa3..d318f144d 100644 --- a/keras/optimizers/legacy/adagrad_test.py +++ b/tf_keras/optimizers/legacy/adagrad_test.py @@ -20,9 +20,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.optimizers.legacy import adagrad -from keras.optimizers.schedules import learning_rate_schedule -from keras.testing_infra import test_combinations +from tf_keras.optimizers.legacy import adagrad +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.testing_infra import test_combinations _DATA_TYPES = [tf.half, tf.float32, tf.float64, tf.complex64, tf.complex128] diff --git a/keras/optimizers/legacy/adam.py b/tf_keras/optimizers/legacy/adam.py similarity index 98% rename from keras/optimizers/legacy/adam.py rename to tf_keras/optimizers/legacy/adam.py index fecc337c4..c0f3f93b0 100644 --- a/keras/optimizers/legacy/adam.py +++ b/tf_keras/optimizers/legacy/adam.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras import backend_config -from keras.optimizers.legacy import optimizer_v2 +from tf_keras import backend_config +from tf_keras.optimizers.legacy import optimizer_v2 # isort: off from tensorflow.python.util.tf_export import keras_export @@ -160,7 +160,7 @@ def _prepare_local(self, var_device, var_dtype, apply_state): def set_weights(self, weights): params = self.weights - # If the weights are generated by Keras V1 optimizer, it includes vhats + # If the weights are generated by TF-Keras V1 optimizer, it includes vhats # even without amsgrad, i.e, V1 optimizer has 3x + 1 variables, while V2 # optimizer has 2x + 1 variables. Filter vhats out for compatibility. num_vars = int((len(params) - 1) / 2) @@ -436,7 +436,7 @@ def _prepare_local(self, var_device, var_dtype, apply_state): def set_weights(self, weights): params = self.weights - # If the weights are generated by Keras V1 optimizer, it includes vhats + # If the weights are generated by TF-Keras V1 optimizer, it includes vhats # even without amsgrad, i.e, V1 optimizer has 3x + 1 variables, while V2 # optimizer has 2x + 1 variables. Filter vhats out for compatibility. num_vars = int((len(params) - 1) / 2) diff --git a/keras/optimizers/legacy/adam_test.py b/tf_keras/optimizers/legacy/adam_test.py similarity index 99% rename from keras/optimizers/legacy/adam_test.py rename to tf_keras/optimizers/legacy/adam_test.py index f796b5a98..7c10e2cd9 100644 --- a/keras/optimizers/legacy/adam_test.py +++ b/tf_keras/optimizers/legacy/adam_test.py @@ -18,10 +18,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.optimizers import optimizer_v1 -from keras.optimizers.legacy import adam -from keras.optimizers.schedules import learning_rate_schedule -from keras.testing_infra import test_combinations +from tf_keras.optimizers import optimizer_v1 +from tf_keras.optimizers.legacy import adam +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.testing_infra import test_combinations def adam_update_numpy( diff --git a/keras/optimizers/legacy/adamax.py b/tf_keras/optimizers/legacy/adamax.py similarity index 98% rename from keras/optimizers/legacy/adamax.py rename to tf_keras/optimizers/legacy/adamax.py index f89690fad..38e15c3d4 100644 --- a/keras/optimizers/legacy/adamax.py +++ b/tf_keras/optimizers/legacy/adamax.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras import backend_config -from keras.optimizers.legacy import optimizer_v2 +from tf_keras import backend_config +from tf_keras.optimizers.legacy import optimizer_v2 # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/optimizers/legacy/adamax_test.py b/tf_keras/optimizers/legacy/adamax_test.py similarity index 99% rename from keras/optimizers/legacy/adamax_test.py rename to tf_keras/optimizers/legacy/adamax_test.py index b0a921dc0..250ff5bc7 100644 --- a/keras/optimizers/legacy/adamax_test.py +++ b/tf_keras/optimizers/legacy/adamax_test.py @@ -18,8 +18,8 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.optimizers.legacy import adamax -from keras.testing_infra import test_combinations +from tf_keras.optimizers.legacy import adamax +from tf_keras.testing_infra import test_combinations def adamax_update_numpy( diff --git a/keras/optimizers/legacy/ftrl.py b/tf_keras/optimizers/legacy/ftrl.py similarity index 99% rename from keras/optimizers/legacy/ftrl.py rename to tf_keras/optimizers/legacy/ftrl.py index 0e592b268..feef19ff6 100644 --- a/keras/optimizers/legacy/ftrl.py +++ b/tf_keras/optimizers/legacy/ftrl.py @@ -17,7 +17,7 @@ import tensorflow.compat.v2 as tf -from keras.optimizers.legacy import optimizer_v2 +from tf_keras.optimizers.legacy import optimizer_v2 # isort: off from tensorflow.python.util.tf_export import keras_export @@ -35,7 +35,7 @@ class Ftrl(optimizer_v2.OptimizerV2): is most suitable for shallow models with large and sparse feature spaces. The algorithm is described by [McMahan et al., 2013](https://research.google.com/pubs/archive/41159.pdf). - The Keras version has support for both online L2 regularization + The TF-Keras version has support for both online L2 regularization (the L2 regularization described in the paper above) and shrinkage-type L2 regularization (which is the addition of an L2 penalty to the loss function). diff --git a/keras/optimizers/legacy/ftrl_test.py b/tf_keras/optimizers/legacy/ftrl_test.py similarity index 99% rename from keras/optimizers/legacy/ftrl_test.py rename to tf_keras/optimizers/legacy/ftrl_test.py index 4c1caa941..70d92f7ec 100644 --- a/keras/optimizers/legacy/ftrl_test.py +++ b/tf_keras/optimizers/legacy/ftrl_test.py @@ -17,7 +17,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.optimizers.legacy import ftrl +from tf_keras.optimizers.legacy import ftrl class FtrlOptimizerTest(tf.test.TestCase): diff --git a/keras/optimizers/legacy/gradient_descent.py b/tf_keras/optimizers/legacy/gradient_descent.py similarity index 99% rename from keras/optimizers/legacy/gradient_descent.py rename to tf_keras/optimizers/legacy/gradient_descent.py index 8d305f705..0451bbe0d 100644 --- a/keras/optimizers/legacy/gradient_descent.py +++ b/tf_keras/optimizers/legacy/gradient_descent.py @@ -17,7 +17,7 @@ import tensorflow.compat.v2 as tf -from keras.optimizers.legacy import optimizer_v2 +from tf_keras.optimizers.legacy import optimizer_v2 # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/optimizers/legacy/gradient_descent_test.py b/tf_keras/optimizers/legacy/gradient_descent_test.py similarity index 99% rename from keras/optimizers/legacy/gradient_descent_test.py rename to tf_keras/optimizers/legacy/gradient_descent_test.py index ec5bc4e99..65f113588 100644 --- a/keras/optimizers/legacy/gradient_descent_test.py +++ b/tf_keras/optimizers/legacy/gradient_descent_test.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.optimizers.legacy import gradient_descent -from keras.optimizers.schedules import learning_rate_schedule -from keras.testing_infra import test_combinations +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.testing_infra import test_combinations class GradientDescentOptimizerTest(tf.test.TestCase, parameterized.TestCase): diff --git a/keras/optimizers/legacy/nadam.py b/tf_keras/optimizers/legacy/nadam.py similarity index 98% rename from keras/optimizers/legacy/nadam.py rename to tf_keras/optimizers/legacy/nadam.py index 263ccca4a..d4291ce6f 100644 --- a/keras/optimizers/legacy/nadam.py +++ b/tf_keras/optimizers/legacy/nadam.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -from keras import backend_config -from keras.optimizers.legacy import optimizer_v2 -from keras.optimizers.schedules import learning_rate_schedule +from tf_keras import backend_config +from tf_keras.optimizers.legacy import optimizer_v2 +from tf_keras.optimizers.schedules import learning_rate_schedule # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/optimizers/legacy/nadam_test.py b/tf_keras/optimizers/legacy/nadam_test.py similarity index 99% rename from keras/optimizers/legacy/nadam_test.py rename to tf_keras/optimizers/legacy/nadam_test.py index aee3453c4..913cb65da 100644 --- a/keras/optimizers/legacy/nadam_test.py +++ b/tf_keras/optimizers/legacy/nadam_test.py @@ -17,7 +17,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.optimizers.legacy import nadam +from tf_keras.optimizers.legacy import nadam def get_beta_accumulators(opt, dtype): diff --git a/keras/optimizers/legacy/optimizer_v2.py b/tf_keras/optimizers/legacy/optimizer_v2.py similarity index 98% rename from keras/optimizers/legacy/optimizer_v2.py rename to tf_keras/optimizers/legacy/optimizer_v2.py index 984d721f0..8035dd7c2 100644 --- a/keras/optimizers/legacy/optimizer_v2.py +++ b/tf_keras/optimizers/legacy/optimizer_v2.py @@ -23,21 +23,21 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras import initializers -from keras.engine import base_layer_utils -from keras.optimizers import utils as optimizer_utils -from keras.optimizers.schedules import learning_rate_schedule -from keras.utils import generic_utils -from keras.utils import layer_utils -from keras.utils import tf_inspect -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras import initializers +from tf_keras.engine import base_layer_utils +from tf_keras.optimizers import utils as optimizer_utils +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.utils import generic_utils +from tf_keras.utils import layer_utils +from tf_keras.utils import tf_inspect +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export keras_optimizers_gauge = tf.__internal__.monitoring.BoolGauge( - "/tensorflow/api/keras/optimizers", "keras optimizer usage", "method" + "/tensorflow/api/tf_keras/optimizers", "keras optimizer usage", "method" ) _DEFAULT_VALID_DTYPES = frozenset( @@ -106,13 +106,13 @@ def name_scope_only_in_function_or_graph(name): v1=["keras.optimizers.Optimizer", "keras.optimizers.legacy.Optimizer"], ) class OptimizerV2(tf.__internal__.tracking.Trackable): - """Base class for legacy Keras optimizers. + """Base class for legacy TF-Keras optimizers. You should not use this class directly, but instead instantiate one of its subclasses such as `tf.keras.optimizers.legacy.SGD`, `tf.keras.optimizers.legacy.Adam`, etc. - This is the default Keras optimizer base class until v2.10 (included). + This is the default TF-Keras optimizer base class until v2.10 (included). In v2.11 and later, `tf.keras.optimizers.Optimizer` points to a new base class implementation. The legacy class won't be deleted in the future and will continue to be available at @@ -138,7 +138,7 @@ class OptimizerV2(tf.__internal__.tracking.Trackable): ### Usage in custom training loops - In Keras models, sometimes variables are created when the model is first + In TF-Keras models, sometimes variables are created when the model is first called, instead of construction time. Examples include 1) sequential models without input shape pre-defined, or 2) subclassed models. Pass var_list as callable in these cases. @@ -210,7 +210,7 @@ class OptimizerV2(tf.__internal__.tracking.Trackable): ### Variable Constraints - All Keras optimizers respect variable constraints. If constraint function is + All TF-Keras optimizers respect variable constraints. If constraint function is passed to any variable, the constraint will be applied to the variable after the gradient has been applied to the variable. Important: If gradient is sparse tensor, variable constraint is not @@ -306,9 +306,9 @@ class OptimizerV2(tf.__internal__.tracking.Trackable): # Subclasses should set this to True unless they override `apply_gradients` # with a version that does not have the `experimental_aggregate_gradients` - # argument. Older versions of Keras did not have this argument so custom + # argument. Older versions of TF-Keras did not have this argument so custom # optimizers may have overridden `apply_gradients` without the - # `experimental_aggregate_gradients` argument. Keras only passes + # `experimental_aggregate_gradients` argument. TF-Keras only passes # `experimental_aggregate_gradients` if this attribute is True. # Note: This attribute will likely be removed in an upcoming release. _HAS_AGGREGATE_GRAD = False @@ -989,7 +989,7 @@ def __getattribute__(self, name): # Needed to avoid infinite recursion with __setattr__. if name == "_hyper": raise e - # Backwards compatibility with Keras optimizers. + # Backwards compatibility with TF-Keras optimizers. if name == "lr": name = "learning_rate" if name in self._hyper: @@ -1006,7 +1006,7 @@ def __dir__(self): def __setattr__(self, name, value): """Override setattr to support dynamic hyperparameter setting.""" - # Backwards compatibility with Keras optimizers. + # Backwards compatibility with TF-Keras optimizers. if name == "lr": name = "learning_rate" if hasattr(self, "_hyper") and name in self._hyper: diff --git a/keras/optimizers/legacy/optimizer_v2_test.py b/tf_keras/optimizers/legacy/optimizer_v2_test.py similarity index 98% rename from keras/optimizers/legacy/optimizer_v2_test.py rename to tf_keras/optimizers/legacy/optimizer_v2_test.py index 47ffec244..6966c72a3 100644 --- a/keras/optimizers/legacy/optimizer_v2_test.py +++ b/tf_keras/optimizers/legacy/optimizer_v2_test.py @@ -21,29 +21,29 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import backend -from keras import callbacks -from keras import losses -from keras.engine import input_layer -from keras.engine import sequential -from keras.engine import training -from keras.layers import core -from keras.layers import regularization -from keras.optimizers import optimizer_v1 -from keras.optimizers.legacy import adadelta -from keras.optimizers.legacy import adagrad -from keras.optimizers.legacy import adam -from keras.optimizers.legacy import adamax -from keras.optimizers.legacy import ftrl -from keras.optimizers.legacy import gradient_descent -from keras.optimizers.legacy import nadam -from keras.optimizers.legacy import optimizer_v2 -from keras.optimizers.legacy import rmsprop -from keras.optimizers.schedules import learning_rate_schedule -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import np_utils +import tf_keras as keras +from tf_keras import backend +from tf_keras import callbacks +from tf_keras import losses +from tf_keras.engine import input_layer +from tf_keras.engine import sequential +from tf_keras.engine import training +from tf_keras.layers import core +from tf_keras.layers import regularization +from tf_keras.optimizers import optimizer_v1 +from tf_keras.optimizers.legacy import adadelta +from tf_keras.optimizers.legacy import adagrad +from tf_keras.optimizers.legacy import adam +from tf_keras.optimizers.legacy import adamax +from tf_keras.optimizers.legacy import ftrl +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.optimizers.legacy import nadam +from tf_keras.optimizers.legacy import optimizer_v2 +from tf_keras.optimizers.legacy import rmsprop +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import np_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/optimizers/legacy/rmsprop.py b/tf_keras/optimizers/legacy/rmsprop.py similarity index 98% rename from keras/optimizers/legacy/rmsprop.py rename to tf_keras/optimizers/legacy/rmsprop.py index 5537de9cc..ad8d43d28 100644 --- a/keras/optimizers/legacy/rmsprop.py +++ b/tf_keras/optimizers/legacy/rmsprop.py @@ -17,8 +17,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend_config -from keras.optimizers.legacy import optimizer_v2 +from tf_keras import backend_config +from tf_keras.optimizers.legacy import optimizer_v2 # isort: off from tensorflow.python.util.tf_export import keras_export @@ -322,7 +322,7 @@ def _resource_apply_sparse(self, grad, var, indices, apply_state=None): def set_weights(self, weights): params = self.weights - # Override set_weights for backward compatibility of Keras V1 optimizer + # Override set_weights for backward compatibility of TF-Keras V1 optimizer # since it does not include iteration at head of the weight list. Set # iteration to 0. if len(params) == len(weights) + 1: diff --git a/keras/optimizers/legacy/rmsprop_test.py b/tf_keras/optimizers/legacy/rmsprop_test.py similarity index 99% rename from keras/optimizers/legacy/rmsprop_test.py rename to tf_keras/optimizers/legacy/rmsprop_test.py index f47d3f6b6..5d7cc6d8c 100644 --- a/keras/optimizers/legacy/rmsprop_test.py +++ b/tf_keras/optimizers/legacy/rmsprop_test.py @@ -22,10 +22,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.optimizers.legacy import rmsprop -from keras.optimizers.schedules import learning_rate_schedule -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras.optimizers.legacy import rmsprop +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.framework import ( diff --git a/keras/optimizers/legacy_learning_rate_decay.py b/tf_keras/optimizers/legacy_learning_rate_decay.py similarity index 99% rename from keras/optimizers/legacy_learning_rate_decay.py rename to tf_keras/optimizers/legacy_learning_rate_decay.py index 8d8c217ce..292c2049b 100644 --- a/keras/optimizers/legacy_learning_rate_decay.py +++ b/tf_keras/optimizers/legacy_learning_rate_decay.py @@ -18,7 +18,7 @@ import tensorflow.compat.v2 as tf -from keras.optimizers.schedules import learning_rate_schedule +from tf_keras.optimizers.schedules import learning_rate_schedule # isort: off from tensorflow.python.util.tf_export import tf_export diff --git a/keras/optimizers/legacy_learning_rate_decay_test.py b/tf_keras/optimizers/legacy_learning_rate_decay_test.py similarity index 99% rename from keras/optimizers/legacy_learning_rate_decay_test.py rename to tf_keras/optimizers/legacy_learning_rate_decay_test.py index d03224265..5751fa18c 100644 --- a/keras/optimizers/legacy_learning_rate_decay_test.py +++ b/tf_keras/optimizers/legacy_learning_rate_decay_test.py @@ -18,7 +18,7 @@ import tensorflow.compat.v2 as tf -from keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_combinations @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/optimizers/lion.py b/tf_keras/optimizers/lion.py similarity index 98% rename from keras/optimizers/lion.py rename to tf_keras/optimizers/lion.py index 8c9084981..0027f3e69 100644 --- a/keras/optimizers/lion.py +++ b/tf_keras/optimizers/lion.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras.optimizers import optimizer -from keras.saving.object_registration import register_keras_serializable +from tf_keras.optimizers import optimizer +from tf_keras.saving.object_registration import register_keras_serializable # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/optimizers/lion_test.py b/tf_keras/optimizers/lion_test.py similarity index 99% rename from keras/optimizers/lion_test.py rename to tf_keras/optimizers/lion_test.py index 6cd44066f..e99860507 100644 --- a/keras/optimizers/lion_test.py +++ b/tf_keras/optimizers/lion_test.py @@ -18,7 +18,7 @@ import tensorflow.compat.v2 as tf from tensorflow.python.framework import dtypes -from keras.optimizers.lion import Lion +from tf_keras.optimizers.lion import Lion def lion_update_numpy( diff --git a/keras/optimizers/nadam.py b/tf_keras/optimizers/nadam.py similarity index 98% rename from keras/optimizers/nadam.py rename to tf_keras/optimizers/nadam.py index c24de7404..2e9e3c3f1 100644 --- a/keras/optimizers/nadam.py +++ b/tf_keras/optimizers/nadam.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras.optimizers import optimizer -from keras.saving.object_registration import register_keras_serializable +from tf_keras.optimizers import optimizer +from tf_keras.saving.object_registration import register_keras_serializable # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/optimizers/optimizer.py b/tf_keras/optimizers/optimizer.py similarity index 98% rename from keras/optimizers/optimizer.py rename to tf_keras/optimizers/optimizer.py index 59f343182..4e5452ff5 100644 --- a/keras/optimizers/optimizer.py +++ b/tf_keras/optimizers/optimizer.py @@ -21,12 +21,12 @@ import tensorflow.compat.v2 as tf from absl import logging -from keras import backend -from keras import initializers -from keras.dtensor import utils as dtensor_utils -from keras.optimizers import utils as optimizer_utils -from keras.optimizers.schedules import learning_rate_schedule -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras import initializers +from tf_keras.dtensor import utils as dtensor_utils +from tf_keras.optimizers import utils as optimizer_utils +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -70,7 +70,7 @@ def __init__( logging.warning( "At this time, the v2.11+ optimizer " f"`tf.keras.optimizers.{self.__class__.__name__}` runs slowly " - "on M1/M2 Macs, please use the legacy Keras optimizer " + "on M1/M2 Macs, please use the legacy TF-Keras optimizer " "instead, located at " f"`tf.keras.optimizers.legacy.{self.__class__.__name__}`." ) @@ -121,7 +121,7 @@ def _process_kwargs(self, kwargs): lr = kwargs.pop("lr", None) if lr: logging.warning( - "`lr` is deprecated in Keras optimizer, please use " + "`lr` is deprecated in TF-Keras optimizer, please use " "`learning_rate` or use the legacy optimizer, e.g.," f"tf.keras.optimizers.legacy.{self.__class__.__name__}." ) @@ -133,7 +133,7 @@ def _process_kwargs(self, kwargs): for k in kwargs: if k in legacy_kwargs: raise ValueError( - f"{k} is deprecated in the new Keras optimizer, please " + f"{k} is deprecated in the new TF-Keras optimizer, please " "check the docstring for valid arguments, or use the " "legacy optimizer, e.g., " f"tf.keras.optimizers.legacy.{self.__class__.__name__}." @@ -146,7 +146,7 @@ def _process_kwargs(self, kwargs): def _create_or_restore_slot_variable(self, **kwargs): raise ValueError( - "You are trying to restore a checkpoint from a legacy Keras " + "You are trying to restore a checkpoint from a legacy TF-Keras " "optimizer into a v2.11+ Optimizer, which can cause " "errors. Please update the optimizer referenced in your code " "to be an instance of " @@ -984,7 +984,7 @@ class Optimizer(_BaseOptimizer): Empirically it has been found that using the exponential moving average (EMA) of the trained parameters of a deep network achieves a better - performance than using its trained parameters directly. Keras optimizers + performance than using its trained parameters directly. TF-Keras optimizers allows users to compute this moving average and overwrite the model variables at desired time. diff --git a/keras/optimizers/optimizer_pss_test.py b/tf_keras/optimizers/optimizer_pss_test.py similarity index 91% rename from keras/optimizers/optimizer_pss_test.py rename to tf_keras/optimizers/optimizer_pss_test.py index f4ff19c98..e08facaf9 100644 --- a/keras/optimizers/optimizer_pss_test.py +++ b/tf_keras/optimizers/optimizer_pss_test.py @@ -3,19 +3,19 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.optimizers import adadelta -from keras.optimizers import adagrad -from keras.optimizers import adam -from keras.optimizers import adamax -from keras.optimizers import adamw -from keras.optimizers import ftrl -from keras.optimizers import lion -from keras.optimizers import nadam -from keras.optimizers import rmsprop -from keras.optimizers import sgd -from keras.utils import dataset_creator -from keras.utils import losses_utils +import tf_keras as keras +from tf_keras.optimizers import adadelta +from tf_keras.optimizers import adagrad +from tf_keras.optimizers import adam +from tf_keras.optimizers import adamax +from tf_keras.optimizers import adamw +from tf_keras.optimizers import ftrl +from tf_keras.optimizers import lion +from tf_keras.optimizers import nadam +from tf_keras.optimizers import rmsprop +from tf_keras.optimizers import sgd +from tf_keras.utils import dataset_creator +from tf_keras.utils import losses_utils ds_combinations = tf.__internal__.distribute.combinations diff --git a/keras/optimizers/optimizer_test.py b/tf_keras/optimizers/optimizer_test.py similarity index 96% rename from keras/optimizers/optimizer_test.py rename to tf_keras/optimizers/optimizer_test.py index f501038a2..ab89ec495 100644 --- a/keras/optimizers/optimizer_test.py +++ b/tf_keras/optimizers/optimizer_test.py @@ -10,27 +10,27 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.optimizers import adadelta as adadelta_new -from keras.optimizers import adafactor as adafactor_new -from keras.optimizers import adagrad as adagrad_new -from keras.optimizers import adam as adam_new -from keras.optimizers import adamax as adamax_new -from keras.optimizers import adamw as adamw_new -from keras.optimizers import ftrl as ftrl_new -from keras.optimizers import lion as lion_new -from keras.optimizers import nadam as nadam_new -from keras.optimizers import rmsprop as rmsprop_new -from keras.optimizers import sgd as sgd_new -from keras.optimizers.legacy import adadelta as adadelta_old -from keras.optimizers.legacy import adagrad as adagrad_old -from keras.optimizers.legacy import adam as adam_old -from keras.optimizers.legacy import ftrl as ftrl_old -from keras.optimizers.legacy import gradient_descent as sgd_old -from keras.optimizers.legacy import rmsprop as rmsprop_old -from keras.optimizers.schedules import learning_rate_schedule -from keras.testing_infra import test_utils -from keras.utils import losses_utils +import tf_keras as keras +from tf_keras.optimizers import adadelta as adadelta_new +from tf_keras.optimizers import adafactor as adafactor_new +from tf_keras.optimizers import adagrad as adagrad_new +from tf_keras.optimizers import adam as adam_new +from tf_keras.optimizers import adamax as adamax_new +from tf_keras.optimizers import adamw as adamw_new +from tf_keras.optimizers import ftrl as ftrl_new +from tf_keras.optimizers import lion as lion_new +from tf_keras.optimizers import nadam as nadam_new +from tf_keras.optimizers import rmsprop as rmsprop_new +from tf_keras.optimizers import sgd as sgd_new +from tf_keras.optimizers.legacy import adadelta as adadelta_old +from tf_keras.optimizers.legacy import adagrad as adagrad_old +from tf_keras.optimizers.legacy import adam as adam_old +from tf_keras.optimizers.legacy import ftrl as ftrl_old +from tf_keras.optimizers.legacy import gradient_descent as sgd_old +from tf_keras.optimizers.legacy import rmsprop as rmsprop_old +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.testing_infra import test_utils +from tf_keras.utils import losses_utils ds_combinations = tf.__internal__.distribute.combinations @@ -525,7 +525,7 @@ def testSaveAndLoadOptimizerWithModel(self, optimizer_fn): self.assertEqual(loaded_optimizer.clipnorm, 0.1) self.assertAllClose(optimizer.variables, loaded_optimizer.variables) - # Save in Keras SavedModel format. + # Save in TF-Keras SavedModel format. model.fit(x, y) path = os.path.join(self.get_temp_dir(), "model") model.save(path) diff --git a/keras/optimizers/optimizer_v1.py b/tf_keras/optimizers/optimizer_v1.py similarity index 99% rename from keras/optimizers/optimizer_v1.py rename to tf_keras/optimizers/optimizer_v1.py index 5cb3544ec..822b41e31 100644 --- a/keras/optimizers/optimizer_v1.py +++ b/tf_keras/optimizers/optimizer_v1.py @@ -21,7 +21,7 @@ import tensorflow.compat.v2 as tf -from keras import backend +from tf_keras import backend class Optimizer: @@ -30,7 +30,7 @@ class Optimizer: Note: this is the parent class of all optimizers, not an actual optimizer that can be used for training models. - All Keras optimizers support the following keyword arguments: + All TF-Keras optimizers support the following keyword arguments: clipnorm: float >= 0. Gradients will be clipped when their L2 norm exceeds this value. @@ -402,7 +402,7 @@ class Adadelta(Optimizer): learning even when many updates have been done. Compared to Adagrad, in the original version of Adadelta you don't have to set an initial learning rate. In this version, initial learning rate and decay factor can - be set, as in most other Keras optimizers. + be set, as in most other TF-Keras optimizers. It is recommended to leave the parameters of this optimizer at their default values. diff --git a/keras/optimizers/optimizer_v1_test.py b/tf_keras/optimizers/optimizer_v1_test.py similarity index 97% rename from keras/optimizers/optimizer_v1_test.py rename to tf_keras/optimizers/optimizer_v1_test.py index 977d573ee..2426923f4 100644 --- a/keras/optimizers/optimizer_v1_test.py +++ b/tf_keras/optimizers/optimizer_v1_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras optimizers.""" +"""Tests for TF-Keras optimizers.""" import gc import weakref @@ -20,11 +20,11 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.optimizers import optimizer_v1 -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import np_utils +import tf_keras as keras +from tf_keras.optimizers import optimizer_v1 +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import np_utils # isort: off from tensorflow.python.training.adam import AdamOptimizer diff --git a/keras/optimizers/rmsprop.py b/tf_keras/optimizers/rmsprop.py similarity index 98% rename from keras/optimizers/rmsprop.py rename to tf_keras/optimizers/rmsprop.py index c59a822ca..7497cbf0e 100644 --- a/keras/optimizers/rmsprop.py +++ b/tf_keras/optimizers/rmsprop.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras.optimizers import optimizer -from keras.saving.object_registration import register_keras_serializable +from tf_keras.optimizers import optimizer +from tf_keras.saving.object_registration import register_keras_serializable # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/tf_keras/optimizers/schedules/BUILD b/tf_keras/optimizers/schedules/BUILD new file mode 100644 index 000000000..323b0b7eb --- /dev/null +++ b/tf_keras/optimizers/schedules/BUILD @@ -0,0 +1,43 @@ +# Description: +# Contains the learning rate schedule API, + +# Placeholder: load unaliased py_library +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") + +package( + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], + default_visibility = [ + "//tf_keras:friends", + "//third_party/tensorflow/python:__pkg__", + "//third_party/tensorflow/python/distribute:__pkg__", + "//third_party/tensorflow/python/trackable:__pkg__", + ], + licenses = ["notice"], +) + +py_library( + name = "learning_rate_schedule", + srcs = [ + "learning_rate_schedule.py", + ], + srcs_version = "PY3", + deps = [ + "//:expect_tensorflow_installed", + "//tf_keras/utils:generic_utils", + ], +) + +cuda_py_test( + name = "learning_rate_schedule_test", + size = "medium", + srcs = ["learning_rate_schedule_test.py"], + shard_count = 4, + deps = [ + "//:expect_absl_installed", # absl/testing:parameterized + "//:expect_numpy_installed", + "//:expect_tensorflow_installed", + "//tf_keras", + "//tf_keras/optimizers/legacy:optimizers", + "//tf_keras/testing_infra:test_combinations", + ], +) diff --git a/keras/optimizers/schedules/__init__.py b/tf_keras/optimizers/schedules/__init__.py similarity index 70% rename from keras/optimizers/schedules/__init__.py rename to tf_keras/optimizers/schedules/__init__.py index cfa6e7a47..7a4500947 100644 --- a/keras/optimizers/schedules/__init__.py +++ b/tf_keras/optimizers/schedules/__init__.py @@ -14,9 +14,9 @@ # ============================================================================== """Learning rate schedule API.""" -from keras.optimizers.schedules.learning_rate_schedule import ExponentialDecay -from keras.optimizers.schedules.learning_rate_schedule import InverseTimeDecay -from keras.optimizers.schedules.learning_rate_schedule import ( +from tf_keras.optimizers.schedules.learning_rate_schedule import ExponentialDecay +from tf_keras.optimizers.schedules.learning_rate_schedule import InverseTimeDecay +from tf_keras.optimizers.schedules.learning_rate_schedule import ( PiecewiseConstantDecay, ) -from keras.optimizers.schedules.learning_rate_schedule import PolynomialDecay +from tf_keras.optimizers.schedules.learning_rate_schedule import PolynomialDecay diff --git a/keras/optimizers/schedules/learning_rate_schedule.py b/tf_keras/optimizers/schedules/learning_rate_schedule.py similarity index 99% rename from keras/optimizers/schedules/learning_rate_schedule.py rename to tf_keras/optimizers/schedules/learning_rate_schedule.py index c017a7d6d..3613c1e8e 100644 --- a/keras/optimizers/schedules/learning_rate_schedule.py +++ b/tf_keras/optimizers/schedules/learning_rate_schedule.py @@ -19,9 +19,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.saving import serialization_lib -from keras.saving.legacy import serialization as legacy_serialization +from tf_keras import backend +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy import serialization as legacy_serialization # isort: off from tensorflow.python.util.tf_export import keras_export @@ -52,7 +52,7 @@ class LearningRateSchedule: To implement your own schedule object, you should implement the `__call__` method, which takes a `step` argument (scalar integer tensor, the current training step count). - Like for any other Keras object, you can also optionally + Like for any other TF-Keras object, you can also optionally make your object serializable by implementing the `get_config` and `from_config` methods. @@ -122,7 +122,7 @@ def decayed_learning_rate(step): You can pass this schedule directly into a `tf.keras.optimizers.Optimizer` as the learning rate. - Example: When fitting a Keras model, decay every 100000 steps with a base + Example: When fitting a TF-Keras model, decay every 100000 steps with a base of 0.96: ```python @@ -496,7 +496,7 @@ def decayed_learning_rate(step): You can pass this schedule directly into a `tf.keras.optimizers.Optimizer` as the learning rate. - Example: Fit a Keras model when decaying 1/t with a rate of 0.5: + Example: Fit a TF-Keras model when decaying 1/t with a rate of 0.5: ```python ... diff --git a/keras/optimizers/schedules/learning_rate_schedule_test.py b/tf_keras/optimizers/schedules/learning_rate_schedule_test.py similarity index 99% rename from keras/optimizers/schedules/learning_rate_schedule_test.py rename to tf_keras/optimizers/schedules/learning_rate_schedule_test.py index e78709d90..7b4588d68 100644 --- a/keras/optimizers/schedules/learning_rate_schedule_test.py +++ b/tf_keras/optimizers/schedules/learning_rate_schedule_test.py @@ -20,9 +20,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.optimizers.legacy import gradient_descent -from keras.optimizers.schedules import learning_rate_schedule -from keras.testing_infra import test_combinations +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.optimizers.schedules import learning_rate_schedule +from tf_keras.testing_infra import test_combinations def _maybe_serialized(lr_decay, serialize_and_deserialize): diff --git a/keras/optimizers/sgd.py b/tf_keras/optimizers/sgd.py similarity index 98% rename from keras/optimizers/sgd.py rename to tf_keras/optimizers/sgd.py index c6f83e1ee..23dd82135 100644 --- a/keras/optimizers/sgd.py +++ b/tf_keras/optimizers/sgd.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras.optimizers import optimizer -from keras.saving.object_registration import register_keras_serializable +from tf_keras.optimizers import optimizer +from tf_keras.saving.object_registration import register_keras_serializable # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/optimizers/utils.py b/tf_keras/optimizers/utils.py similarity index 100% rename from keras/optimizers/utils.py rename to tf_keras/optimizers/utils.py diff --git a/keras/premade_models/BUILD b/tf_keras/premade_models/BUILD similarity index 66% rename from keras/premade_models/BUILD rename to tf_keras/premade_models/BUILD index 3441331df..6f0f83778 100644 --- a/keras/premade_models/BUILD +++ b/tf_keras/premade_models/BUILD @@ -1,13 +1,13 @@ # Placeholder: load unaliased py_library # Description: -# Contains the Keras Premade Models (internal TensorFlow version). -load("@org_keras//keras:keras.bzl", "tf_py_test") +# Contains the TF-Keras Premade Models (internal TensorFlow version). +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", ], licenses = ["notice"], ) @@ -22,8 +22,8 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend_config", - "//keras:regularizers", + "//tf_keras:backend_config", + "//tf_keras:regularizers", ], ) @@ -37,8 +37,8 @@ tf_py_test( ":premade_models", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -53,7 +53,7 @@ tf_py_test( ":premade_models", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/keras/premade_models/__init__.py b/tf_keras/premade_models/__init__.py similarity index 88% rename from keras/premade_models/__init__.py rename to tf_keras/premade_models/__init__.py index 49b80f388..1de6f3530 100644 --- a/keras/premade_models/__init__.py +++ b/tf_keras/premade_models/__init__.py @@ -14,5 +14,5 @@ # ============================================================================== """Premade Model API.""" -from keras.premade_models import linear -from keras.premade_models import wide_deep +from tf_keras.premade_models import linear +from tf_keras.premade_models import wide_deep diff --git a/keras/premade_models/linear.py b/tf_keras/premade_models/linear.py similarity index 96% rename from keras/premade_models/linear.py rename to tf_keras/premade_models/linear.py index e24236166..8f5e056c9 100644 --- a/keras/premade_models/linear.py +++ b/tf_keras/premade_models/linear.py @@ -16,13 +16,13 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import initializers -from keras import regularizers -from keras.engine import base_layer -from keras.engine import input_spec -from keras.engine import training -from keras.layers import core +from tf_keras import activations +from tf_keras import initializers +from tf_keras import regularizers +from tf_keras.engine import base_layer +from tf_keras.engine import input_spec +from tf_keras.engine import training +from tf_keras.layers import core # isort: off from tensorflow.python.util import deprecation diff --git a/keras/premade_models/linear_test.py b/tf_keras/premade_models/linear_test.py similarity index 94% rename from keras/premade_models/linear_test.py rename to tf_keras/premade_models/linear_test.py index 9d7d83b76..fe7cd15c6 100644 --- a/keras/premade_models/linear_test.py +++ b/tf_keras/premade_models/linear_test.py @@ -12,21 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras Premade Linear models.""" +"""Tests for TF-Keras Premade Linear models.""" import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import losses -from keras.engine import input_layer -from keras.engine import sequential -from keras.engine import training -from keras.feature_column import dense_features_v2 -from keras.layers import core -from keras.optimizers.legacy import gradient_descent -from keras.premade_models import linear -from keras.testing_infra import test_combinations +from tf_keras import backend +from tf_keras import losses +from tf_keras.engine import input_layer +from tf_keras.engine import sequential +from tf_keras.engine import training +from tf_keras.feature_column import dense_features_v2 +from tf_keras.layers import core +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.premade_models import linear +from tf_keras.testing_infra import test_combinations @test_combinations.run_all_keras_modes(always_skip_v1=True) diff --git a/keras/premade_models/wide_deep.py b/tf_keras/premade_models/wide_deep.py similarity index 97% rename from keras/premade_models/wide_deep.py rename to tf_keras/premade_models/wide_deep.py index b06aa60cf..d8950b6f8 100644 --- a/keras/premade_models/wide_deep.py +++ b/tf_keras/premade_models/wide_deep.py @@ -16,13 +16,13 @@ import tensorflow.compat.v2 as tf -from keras import activations -from keras import backend -from keras import layers as layer_module -from keras.engine import base_layer -from keras.engine import data_adapter -from keras.engine import training as keras_training -from keras.saving import serialization_lib +from tf_keras import activations +from tf_keras import backend +from tf_keras import layers as layer_module +from tf_keras.engine import base_layer +from tf_keras.engine import data_adapter +from tf_keras.engine import training as keras_training +from tf_keras.saving import serialization_lib # isort: off from tensorflow.python.util import deprecation diff --git a/keras/premade_models/wide_deep_test.py b/tf_keras/premade_models/wide_deep_test.py similarity index 96% rename from keras/premade_models/wide_deep_test.py rename to tf_keras/premade_models/wide_deep_test.py index 076c12efb..d062dd60a 100644 --- a/keras/premade_models/wide_deep_test.py +++ b/tf_keras/premade_models/wide_deep_test.py @@ -12,21 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras Premade WideNDeep models.""" +"""Tests for TF-Keras Premade WideNDeep models.""" import numpy as np import tensorflow.compat.v2 as tf -from keras.engine import input_layer -from keras.engine import sequential -from keras.engine import training -from keras.feature_column import dense_features_v2 -from keras.layers import core -from keras.optimizers.legacy import gradient_descent -from keras.premade_models import linear -from keras.premade_models import wide_deep -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras.engine import input_layer +from tf_keras.engine import sequential +from tf_keras.engine import training +from tf_keras.feature_column import dense_features_v2 +from tf_keras.layers import core +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.premade_models import linear +from tf_keras.premade_models import wide_deep +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_combinations.run_all_keras_modes(always_skip_v1=True) diff --git a/keras/preprocessing/BUILD b/tf_keras/preprocessing/BUILD similarity index 74% rename from keras/preprocessing/BUILD rename to tf_keras/preprocessing/BUILD index f4613447a..986a0a25f 100644 --- a/keras/preprocessing/BUILD +++ b/tf_keras/preprocessing/BUILD @@ -1,13 +1,13 @@ # Description: -# Contains the Keras preprocessing layers (internal TensorFlow version). +# Contains the TF-Keras preprocessing layers (internal TensorFlow version). # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", ], licenses = ["notice"], ) @@ -22,7 +22,7 @@ py_library( ":image", ":sequence", ":text", - "//keras/utils", + "//tf_keras/utils", ], ) @@ -38,9 +38,9 @@ py_library( "//:expect_pillow_installed", "//:expect_scipy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/utils:data_utils", - "//keras/utils:image_utils", + "//tf_keras:backend", + "//tf_keras/utils:data_utils", + "//tf_keras/utils:image_utils", ], ) @@ -52,7 +52,7 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/utils:data_utils", + "//tf_keras/utils:data_utils", ], ) @@ -77,8 +77,8 @@ tf_py_test( ":image", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -91,7 +91,7 @@ tf_py_test( ":sequence", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -104,6 +104,6 @@ tf_py_test( ":text", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/keras/preprocessing/__init__.py b/tf_keras/preprocessing/__init__.py similarity index 87% rename from keras/preprocessing/__init__.py rename to tf_keras/preprocessing/__init__.py index 1c9bbc75f..309fd7a04 100644 --- a/keras/preprocessing/__init__.py +++ b/tf_keras/preprocessing/__init__.py @@ -25,9 +25,9 @@ https://www.tensorflow.org/tutorials/load_data/images), and [augmenting images]( https://www.tensorflow.org/tutorials/images/data_augmentation), as well as the [preprocessing layer guide]( -https://www.tensorflow.org/guide/keras/preprocessing_layers). +https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). """ -from keras import backend -from keras.preprocessing import image -from keras.preprocessing import sequence -from keras.preprocessing import text +from tf_keras import backend +from tf_keras.preprocessing import image +from tf_keras.preprocessing import sequence +from tf_keras.preprocessing import text diff --git a/keras/preprocessing/image.py b/tf_keras/preprocessing/image.py similarity index 99% rename from keras/preprocessing/image.py rename to tf_keras/preprocessing/image.py index 2aec637f5..f201a4ede 100644 --- a/keras/preprocessing/image.py +++ b/tf_keras/preprocessing/image.py @@ -24,7 +24,7 @@ https://www.tensorflow.org/tutorials/load_data/images) and [augmenting images]( https://www.tensorflow.org/tutorials/images/data_augmentation), as well as the [preprocessing layer guide]( -https://www.tensorflow.org/guide/keras/preprocessing_layers). +https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). """ import collections @@ -35,10 +35,10 @@ import numpy as np -from keras import backend -from keras.utils import data_utils -from keras.utils import image_utils -from keras.utils import io_utils +from tf_keras import backend +from tf_keras.utils import data_utils +from tf_keras.utils import image_utils +from tf_keras.utils import io_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -68,7 +68,7 @@ class Iterator(data_utils.Sequence): [augmenting images]( https://www.tensorflow.org/tutorials/images/data_augmentation), as well as the [preprocessing layer guide]( - https://www.tensorflow.org/guide/keras/preprocessing_layers). + https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Every `Iterator` must implement the `_get_batches_of_transformed_samples` method. @@ -459,7 +459,7 @@ class DirectoryIterator(BatchFromFilesMixin, Iterator): [augmenting images]( https://www.tensorflow.org/tutorials/images/data_augmentation), as well as the [preprocessing layer guide]( - https://www.tensorflow.org/guide/keras/preprocessing_layers). + https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: directory: Path to the directory to read images from. Each subdirectory @@ -635,7 +635,7 @@ class NumpyArrayIterator(Iterator): [augmenting images]( https://www.tensorflow.org/tutorials/images/data_augmentation), as well as the [preprocessing layer guide]( - https://www.tensorflow.org/guide/keras/preprocessing_layers). + https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: x: Numpy array of input data or tuple. If tuple, the second elements is @@ -1176,7 +1176,7 @@ class ImageDataGenerator: [augmenting images]( https://www.tensorflow.org/tutorials/images/data_augmentation), as well as the [preprocessing layer guide]( - https://www.tensorflow.org/guide/keras/preprocessing_layers). + https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). The data will be looped over (in batches). @@ -1237,7 +1237,7 @@ class ImageDataGenerator: have shape `(samples, height, width, channels)`, "channels_first" mode means that the images should have shape `(samples, channels, height, width)`. When unspecified, uses `image_data_format` value found in - your Keras config file at `~/.keras/keras.json` (if exists) else + your TF-Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to "channels_last". validation_split: Float. Fraction of images reserved for validation (strictly between 0 and 1). @@ -2165,7 +2165,7 @@ def random_rotation( [augmenting images]( https://www.tensorflow.org/tutorials/images/data_augmentation), as well as the [preprocessing layer guide]( - https://www.tensorflow.org/guide/keras/preprocessing_layers). + https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: x: Input tensor. Must be 3D. @@ -2219,7 +2219,7 @@ def random_shift( [augmenting images]( https://www.tensorflow.org/tutorials/images/data_augmentation), as well as the [preprocessing layer guide]( - https://www.tensorflow.org/guide/keras/preprocessing_layers). + https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: x: Input tensor. Must be 3D. @@ -2320,7 +2320,7 @@ def random_zoom( [augmenting images]( https://www.tensorflow.org/tutorials/images/data_augmentation), as well as the [preprocessing layer guide]( - https://www.tensorflow.org/guide/keras/preprocessing_layers). + https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: x: Input tensor. Must be 3D. @@ -2446,7 +2446,7 @@ def random_brightness(x, brightness_range, scale=True): [augmenting images]( https://www.tensorflow.org/tutorials/images/data_augmentation), as well as the [preprocessing layer guide]( - https://www.tensorflow.org/guide/keras/preprocessing_layers). + https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). Args: x: Input tensor. Must be 3D. diff --git a/keras/preprocessing/image_test.py b/tf_keras/preprocessing/image_test.py similarity index 99% rename from keras/preprocessing/image_test.py rename to tf_keras/preprocessing/image_test.py index 90a379cc8..76f4eb45d 100644 --- a/keras/preprocessing/image_test.py +++ b/tf_keras/preprocessing/image_test.py @@ -24,12 +24,12 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import layers -from keras.engine import sequential -from keras.preprocessing import image -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import image_utils +from tf_keras import layers +from tf_keras.engine import sequential +from tf_keras.preprocessing import image +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import image_utils try: import PIL diff --git a/keras/preprocessing/sequence.py b/tf_keras/preprocessing/sequence.py similarity index 98% rename from keras/preprocessing/sequence.py rename to tf_keras/preprocessing/sequence.py index 255691187..3f97f5bef 100644 --- a/keras/preprocessing/sequence.py +++ b/tf_keras/preprocessing/sequence.py @@ -27,7 +27,7 @@ import numpy as np -from keras.utils import data_utils +from tf_keras.utils import data_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -97,12 +97,12 @@ class TimeseriesGenerator(data_utils.Sequence): Returns: A [Sequence]( - https://www.tensorflow.org/api_docs/python/tf/keras/utils/Sequence) + https://www.tensorflow.org/api_docs/python/tf/tf_keras/utils/Sequence) instance. Examples: ```python - from keras.preprocessing.sequence import TimeseriesGenerator + from tf_keras.preprocessing.sequence import TimeseriesGenerator import numpy as np data = np.array([[i] for i in range(50)]) targets = np.array([[i] for i in range(50)]) diff --git a/keras/preprocessing/sequence_test.py b/tf_keras/preprocessing/sequence_test.py similarity index 99% rename from keras/preprocessing/sequence_test.py rename to tf_keras/preprocessing/sequence_test.py index a5b2637ef..e223b561b 100644 --- a/keras/preprocessing/sequence_test.py +++ b/tf_keras/preprocessing/sequence_test.py @@ -19,7 +19,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.preprocessing import sequence +from tf_keras.preprocessing import sequence class TestSequence(tf.test.TestCase): diff --git a/keras/preprocessing/text.py b/tf_keras/preprocessing/text.py similarity index 98% rename from keras/preprocessing/text.py rename to tf_keras/preprocessing/text.py index a429fb4b5..01d4c157e 100644 --- a/keras/preprocessing/text.py +++ b/tf_keras/preprocessing/text.py @@ -21,7 +21,7 @@ the [text loading tutorial] (https://www.tensorflow.org/tutorials/load_data/text) and [preprocessing layer guide] -(https://www.tensorflow.org/guide/keras/preprocessing_layers). +(https://www.tensorflow.org/guide/tf_keras/preprocessing_layers). """ @@ -97,7 +97,7 @@ def one_hot( `tf.keras.layers.Hashing` with `output_mode='one_hot'` which provides equivalent functionality through a layer which accepts `tf.Tensor` input. See the [preprocessing layer guide] - (https://www.tensorflow.org/guide/keras/preprocessing_layers) for an + (https://www.tensorflow.org/guide/tf_keras/preprocessing_layers) for an overview of preprocessing layers. This function receives as input a string of text and returns a @@ -148,7 +148,7 @@ def hashing_trick( tensors and is not recommended for new code. Prefer `tf.keras.layers.Hashing` which provides equivalent functionality through a layer which accepts `tf.Tensor` input. See the [preprocessing layer guide]( - https://www.tensorflow.org/guide/keras/preprocessing_layers) for an + https://www.tensorflow.org/guide/tf_keras/preprocessing_layers) for an overview of preprocessing layers. Args: @@ -590,7 +590,7 @@ def tokenizer_from_json(json_string): json_string: JSON string encoding a tokenizer configuration. Returns: - A Keras Tokenizer instance + A TF-Keras Tokenizer instance """ tokenizer_config = json.loads(json_string) config = tokenizer_config.get("config") diff --git a/keras/preprocessing/text_test.py b/tf_keras/preprocessing/text_test.py similarity index 99% rename from keras/preprocessing/text_test.py rename to tf_keras/preprocessing/text_test.py index a73e81ccc..6b2181786 100644 --- a/keras/preprocessing/text_test.py +++ b/tf_keras/preprocessing/text_test.py @@ -20,7 +20,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.preprocessing import text +from tf_keras.preprocessing import text class TestText(tf.test.TestCase): diff --git a/keras/protobuf/BUILD b/tf_keras/protobuf/BUILD similarity index 77% rename from keras/protobuf/BUILD rename to tf_keras/protobuf/BUILD index e2f9c1f3b..dc58d6b13 100644 --- a/keras/protobuf/BUILD +++ b/tf_keras/protobuf/BUILD @@ -1,12 +1,12 @@ # Description: -# Contains Keras protobufs +# Contains TF-Keras protobufs load("@com_google_protobuf//:protobuf.bzl", "py_proto_library") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", ], licenses = ["notice"], # Apache 2.0 ) diff --git a/keras/protobuf/projector_config.proto b/tf_keras/protobuf/projector_config.proto similarity index 97% rename from keras/protobuf/projector_config.proto rename to tf_keras/protobuf/projector_config.proto index 056249466..57b93006f 100644 --- a/keras/protobuf/projector_config.proto +++ b/tf_keras/protobuf/projector_config.proto @@ -19,7 +19,7 @@ limitations under the License. syntax = "proto3"; -package third_party.py.keras.protobuf; +package third_party.py.tf_keras.protobuf; message SpriteMetadata { string image_path = 1; diff --git a/keras/protobuf/saved_metadata.proto b/tf_keras/protobuf/saved_metadata.proto similarity index 77% rename from keras/protobuf/saved_metadata.proto rename to tf_keras/protobuf/saved_metadata.proto index 264a6974c..5c47e3e8b 100644 --- a/keras/protobuf/saved_metadata.proto +++ b/tf_keras/protobuf/saved_metadata.proto @@ -12,21 +12,21 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -// Protobuf containing the metadata for each Keras object saved in a SavedModel. +// Protobuf containing the metadata for each TF-Keras object saved in a SavedModel. syntax = "proto3"; -package third_party.py.keras.protobuf; +package third_party.py.tf_keras.protobuf; -import "keras/protobuf/versions.proto"; +import "tf_keras/protobuf/versions.proto"; message SavedMetadata { // Nodes represent trackable objects in the SavedModel. The data for every - // Keras object is stored. + // TF-Keras object is stored. repeated SavedObject nodes = 1; } -// Metadata of an individual Keras object. +// Metadata of an individual TF-Keras object. message SavedObject { reserved 1; // For previous VersionDef info. @@ -42,9 +42,9 @@ message SavedObject { // _tf_keras_sequential string identifier = 4; // Metadata containing a JSON-serialized object with the non-TensorFlow - // attributes for this Keras object. + // attributes for this TF-Keras object. string metadata = 5; - // Version defined by the code serializing this Keras object. - third_party.py.keras.protobuf.VersionDef version = 6; + // Version defined by the code serializing this TF-Keras object. + third_party.py.tf_keras.protobuf.VersionDef version = 6; } diff --git a/keras/protobuf/versions.proto b/tf_keras/protobuf/versions.proto similarity index 93% rename from keras/protobuf/versions.proto rename to tf_keras/protobuf/versions.proto index 0bf954fa8..a9922f324 100644 --- a/keras/protobuf/versions.proto +++ b/tf_keras/protobuf/versions.proto @@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -// Protobuf containing the version for each Keras object saved in a SavedModel. +// Protobuf containing the version for each TF-Keras object saved in a SavedModel. syntax = "proto3"; -package third_party.py.keras.protobuf; +package third_party.py.tf_keras.protobuf; // This file is a copy of the TensorFlow Versions proto. // Keep this file in sync with the source proto definition at diff --git a/keras/regularizers.py b/tf_keras/regularizers.py similarity index 96% rename from keras/regularizers.py rename to tf_keras/regularizers.py index 763b99097..c7aba9362 100644 --- a/keras/regularizers.py +++ b/tf_keras/regularizers.py @@ -20,10 +20,10 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.saving.legacy import serialization as legacy_serialization -from keras.saving.serialization_lib import deserialize_keras_object -from keras.saving.serialization_lib import serialize_keras_object +from tf_keras import backend +from tf_keras.saving.legacy import serialization as legacy_serialization +from tf_keras.saving.serialization_lib import deserialize_keras_object +from tf_keras.saving.serialization_lib import serialize_keras_object # isort: off from tensorflow.python.util.tf_export import keras_export @@ -159,7 +159,7 @@ class Regularizer: and loading weight checkpoints. Registration is required for saving and - loading models to HDF5 format, Keras model cloning, some visualization + loading models to HDF5 format, TF-Keras model cloning, some visualization utilities, and exporting models to and from JSON. If using this functionality, you must make sure any python process running your model has also defined and registered your custom regularizer. @@ -177,8 +177,8 @@ def from_config(cls, config): capable of instantiating the same regularizer from the config dictionary. - This method is used by Keras `model_to_estimator`, saving and - loading models to HDF5 formats, Keras model cloning, some visualization + This method is used by TF-Keras `model_to_estimator`, saving and + loading models to HDF5 formats, TF-Keras model cloning, some visualization utilities, and exporting models to and from JSON. Args: @@ -200,8 +200,8 @@ def get_config(self): This method is optional if you are just training and executing models, exporting to and from SavedModels, or using weight checkpoints. - This method is required for Keras `model_to_estimator`, saving and - loading models to HDF5 formats, Keras model cloning, some visualization + This method is required for TF-Keras `model_to_estimator`, saving and + loading models to HDF5 formats, TF-Keras model cloning, some visualization utilities, and exporting models to and from JSON. Returns: diff --git a/keras/regularizers_test.py b/tf_keras/regularizers_test.py similarity index 98% rename from keras/regularizers_test.py rename to tf_keras/regularizers_test.py index e8bc3606e..11a08c7f3 100644 --- a/keras/regularizers_test.py +++ b/tf_keras/regularizers_test.py @@ -12,17 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras regularizers.""" +"""Tests for TF-Keras regularizers.""" import numpy as np import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import regularizers -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import np_utils +import tf_keras as keras +from tf_keras import regularizers +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import np_utils DATA_DIM = 5 NUM_CLASSES = 2 diff --git a/keras/saving/BUILD b/tf_keras/saving/BUILD similarity index 65% rename from keras/saving/BUILD rename to tf_keras/saving/BUILD index ab4a8830f..b4303fd0e 100644 --- a/keras/saving/BUILD +++ b/tf_keras/saving/BUILD @@ -1,14 +1,14 @@ # Description: -# Contains the Keras save model API (internal TensorFlow version). +# Contains the TF-Keras save model API (internal TensorFlow version). # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], # TODO(scottzhu): Remove non-keras deps from TF. default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/tensorflow/python/distribute:__pkg__", ], licenses = ["notice"], @@ -33,17 +33,17 @@ py_library( "//:expect_h5py_installed", "//:expect_tensorflow_installed", "//:expect_yaml_installed", - "//keras:backend", - "//keras:losses", - "//keras:regularizers", - "//keras/engine:input_spec", - "//keras/mixed_precision:autocast_variable", - "//keras/optimizers", - "//keras/protobuf:saved_metadata_proto_py_pb2", - "//keras/saving/legacy/saved_model", - "//keras/utils:engine_utils", - "//keras/utils:metrics_utils", - "//keras/utils:mode_keys", + "//tf_keras:backend", + "//tf_keras:losses", + "//tf_keras:regularizers", + "//tf_keras/engine:input_spec", + "//tf_keras/mixed_precision:autocast_variable", + "//tf_keras/optimizers", + "//tf_keras/protobuf:saved_metadata_proto_py_pb2", + "//tf_keras/saving/legacy/saved_model", + "//tf_keras/utils:engine_utils", + "//tf_keras/utils:metrics_utils", + "//tf_keras/utils:mode_keys", ], ) @@ -56,8 +56,8 @@ py_library( deps = [ ":serialization_lib", "//:expect_tensorflow_installed", - "//keras/utils:generic_utils", - "//keras/utils:io_utils", + "//tf_keras/utils:generic_utils", + "//tf_keras/utils:io_utils", ], ) @@ -67,11 +67,11 @@ tf_py_test( srcs = ["saving_lib_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/utils:generic_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/utils:generic_utils", ], ) @@ -94,7 +94,7 @@ py_library( ":serialization", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/saving/legacy/saved_model:utils", + "//tf_keras/saving/legacy/saved_model:utils", ], ) @@ -108,8 +108,8 @@ py_library( ":object_registration", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/utils:tf_contextlib", - "//keras/utils:tf_inspect", + "//tf_keras/utils:tf_contextlib", + "//tf_keras/utils:tf_inspect", ], ) @@ -120,7 +120,7 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -134,11 +134,11 @@ tf_py_test( "notsan", # TODO(b/170870790) ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -149,11 +149,11 @@ tf_py_test( python_version = "PY3", shard_count = 4, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -164,11 +164,11 @@ tf_py_test( python_version = "PY3", shard_count = 4, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -184,11 +184,11 @@ tf_py_test( "no_windows", ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -202,11 +202,11 @@ tf_py_test( "no_pip", # TODO(b/202022379) ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -217,11 +217,11 @@ tf_py_test( python_version = "PY3", tags = ["notsan"], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -231,10 +231,10 @@ tf_py_test( srcs = ["serialization_lib_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/saving:serialization", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/saving:serialization", + "//tf_keras/testing_infra:test_combinations", ], ) diff --git a/keras/saving/__init__.py b/tf_keras/saving/__init__.py similarity index 100% rename from keras/saving/__init__.py rename to tf_keras/saving/__init__.py diff --git a/keras/saving/legacy/__init__.py b/tf_keras/saving/legacy/__init__.py similarity index 100% rename from keras/saving/legacy/__init__.py rename to tf_keras/saving/legacy/__init__.py diff --git a/keras/saving/legacy/hdf5_format.py b/tf_keras/saving/legacy/hdf5_format.py similarity index 96% rename from keras/saving/legacy/hdf5_format.py rename to tf_keras/saving/legacy/hdf5_format.py index 8d4a95eea..b4f74f02a 100644 --- a/keras/saving/legacy/hdf5_format.py +++ b/tf_keras/saving/legacy/hdf5_format.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== -"""Functions for saving and loading a Keras Model from HDF5 format.""" +"""Functions for saving and loading a TF-Keras Model from HDF5 format.""" import json import os @@ -21,15 +21,15 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.optimizers import optimizer as optimizer_base -from keras.optimizers import optimizer_v1 -from keras.saving import object_registration -from keras.saving.legacy import model_config as model_config_lib -from keras.saving.legacy import saving_utils -from keras.saving.legacy.saved_model import json_utils -from keras.utils.generic_utils import LazyLoader -from keras.utils.io_utils import ask_to_proceed_with_overwrite +from tf_keras import backend +from tf_keras.optimizers import optimizer as optimizer_base +from tf_keras.optimizers import optimizer_v1 +from tf_keras.saving import object_registration +from tf_keras.saving.legacy import model_config as model_config_lib +from tf_keras.saving.legacy import saving_utils +from tf_keras.saving.legacy.saved_model import json_utils +from tf_keras.utils.generic_utils import LazyLoader +from tf_keras.utils.io_utils import ask_to_proceed_with_overwrite # isort: off from tensorflow.python.platform import tf_logging as logging @@ -45,7 +45,7 @@ # once the issue with copybara is fixed. sequential_lib = LazyLoader( - "sequential_lib", globals(), "keras.engine.sequential" + "sequential_lib", globals(), "tf_keras.engine.sequential" ) @@ -62,7 +62,7 @@ def save_model_to_hdf5(model, filepath, overwrite=True, include_optimizer=True): used for model definition or training. Args: - model: Keras model instance to be saved. + model: TF-Keras model instance to be saved. filepath: One of the following: - String, path where to save the model - `h5py.File` object where to save the model @@ -159,7 +159,7 @@ def load_model_from_hdf5(filepath, custom_objects=None, compile=True): after loading. Returns: - A Keras model instance. If an optimizer was found + A TF-Keras model instance. If an optimizer was found as part of the saved model, the model is already compiled. Otherwise, the model is uncompiled and a warning will be displayed. When `compile` is set @@ -267,16 +267,16 @@ def load_model_from_hdf5(filepath, custom_objects=None, compile=True): def preprocess_weights_for_loading( layer, weights, original_keras_version=None, original_backend=None ): - """Preprocess layer weights between different Keras formats. + """Preprocess layer weights between different TF-Keras formats. - Converts layers weights from Keras 1 format to Keras 2 and also weights of - cuDNN layers in Keras 2. + Converts layers weights from TF-Keras 1 format to TF-Keras 2 and also weights of + cuDNN layers in TF-Keras 2. Args: layer: Layer instance. weights: List of weights values (Numpy arrays). - original_keras_version: Keras version for the weights, as a string. - original_backend: Keras backend the weights were trained with, + original_keras_version: TF-Keras version for the weights, as a string. + original_backend: TF-Keras backend the weights were trained with, as a string. Returns: @@ -373,7 +373,7 @@ def convert_nested_model(weights): return new_trainable_weights + new_non_trainable_weights # Convert layers nested in Bidirectional/Model/Sequential. - # Both transformation should be ran for both Keras 1->2 conversion + # Both transformation should be ran for both TF-Keras 1->2 conversion # and for conversion of cuDNN layers. if layer.__class__.__name__ == "Bidirectional": weights = convert_nested_bidirectional(weights) @@ -390,7 +390,7 @@ def convert_nested_model(weights): if layer.__class__.__name__ == "Conv1D": shape = weights[0].shape - # Handle Keras 1.1 format + # Handle TF-Keras 1.1 format if ( shape[:2] != (layer.kernel_size[0], 1) or shape[3] != layer.filters @@ -535,7 +535,7 @@ def transpose_input(from_cudnn): It keeps the shape, but changes between the layout (Fortran/C). Eg.: ``` - Keras cuDNN + TF-Keras cuDNN [[0, 1, 2], <---> [[0, 2, 4], [3, 4, 5]] [1, 3, 5]] ``` @@ -544,7 +544,7 @@ def transpose_input(from_cudnn): Args: from_cudnn: `True` if source weights are in cuDNN format, `False` if - they're in plain Keras format. + they're in plain TF-Keras format. Returns: Function that converts input kernel to the other format. @@ -741,7 +741,7 @@ def save_weights_to_hdf5_group(f, model): f: HDF5 group. model: Model instance. """ - from keras import __version__ as keras_version + from tf_keras import __version__ as keras_version save_attributes_to_hdf5_group( f, "layer_names", [layer.name.encode("utf8") for layer in model.layers] diff --git a/keras/saving/legacy/losses_serialization_test.py b/tf_keras/saving/legacy/losses_serialization_test.py similarity index 95% rename from keras/saving/legacy/losses_serialization_test.py rename to tf_keras/saving/legacy/losses_serialization_test.py index 3a4df6ad8..b9ca33145 100644 --- a/keras/saving/legacy/losses_serialization_test.py +++ b/tf_keras/saving/legacy/losses_serialization_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras losses serialization.""" +"""Tests for TF-Keras losses serialization.""" import os import shutil @@ -21,13 +21,13 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import layers -from keras import losses -from keras.optimizers import legacy as optimizer_legacy -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import losses_utils +import tf_keras as keras +from tf_keras import layers +from tf_keras import losses +from tf_keras.optimizers import legacy as optimizer_legacy +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import losses_utils try: import h5py diff --git a/keras/saving/legacy/metrics_serialization_test.py b/tf_keras/saving/legacy/metrics_serialization_test.py similarity index 96% rename from keras/saving/legacy/metrics_serialization_test.py rename to tf_keras/saving/legacy/metrics_serialization_test.py index 9956657d0..463a739a6 100644 --- a/keras/saving/legacy/metrics_serialization_test.py +++ b/tf_keras/saving/legacy/metrics_serialization_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras metrics serialization.""" +"""Tests for TF-Keras metrics serialization.""" import os import shutil @@ -21,13 +21,13 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import layers -from keras import metrics -from keras.optimizers import legacy as optimizer_legacy -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import custom_object_scope +import tf_keras as keras +from tf_keras import layers +from tf_keras import metrics +from tf_keras.optimizers import legacy as optimizer_legacy +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import custom_object_scope try: import h5py diff --git a/keras/saving/legacy/model_config.py b/tf_keras/saving/legacy/model_config.py similarity index 92% rename from keras/saving/legacy/model_config.py rename to tf_keras/saving/legacy/model_config.py index a916289b3..7c1ecc855 100644 --- a/keras/saving/legacy/model_config.py +++ b/tf_keras/saving/legacy/model_config.py @@ -19,14 +19,14 @@ import threading from tensorflow.python.util.tf_export import keras_export -from keras.saving.legacy import serialization +from tf_keras.saving.legacy import serialization MODULE_OBJECTS = threading.local() @keras_export("keras.models.model_from_config") def model_from_config(config, custom_objects=None): - """Instantiates a Keras model from its config. + """Instantiates a TF-Keras model from its config. Usage: ``` @@ -44,7 +44,7 @@ def model_from_config(config, custom_objects=None): considered during deserialization. Returns: - A Keras model instance (uncompiled). + A TF-Keras model instance (uncompiled). Raises: TypeError: if `config` is not a dictionary. @@ -55,7 +55,7 @@ def model_from_config(config, custom_objects=None): f"Received: config={config}. Did you meant to use " "`Sequential.from_config(config)`?" ) - from keras import layers + from tf_keras import layers global MODULE_OBJECTS @@ -85,7 +85,7 @@ def model_from_yaml(yaml_string, custom_objects=None): considered during deserialization. Returns: - A Keras model instance (uncompiled). + A TF-Keras model instance (uncompiled). Raises: RuntimeError: announces that the method poses a security risk @@ -116,9 +116,9 @@ def model_from_json(json_string, custom_objects=None): considered during deserialization. Returns: - A Keras model instance (uncompiled). + A TF-Keras model instance (uncompiled). """ - from keras.layers import ( + from tf_keras.layers import ( deserialize_from_json, ) diff --git a/keras/saving/legacy/save.py b/tf_keras/saving/legacy/save.py similarity index 95% rename from keras/saving/legacy/save.py rename to tf_keras/saving/legacy/save.py index 4c6a38253..b37ecdd09 100644 --- a/keras/saving/legacy/save.py +++ b/tf_keras/saving/legacy/save.py @@ -18,17 +18,17 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.saving import object_registration -from keras.saving.legacy import hdf5_format -from keras.saving.legacy import saving_utils -from keras.saving.legacy import serialization -from keras.saving.legacy.saved_model import load as saved_model_load -from keras.saving.legacy.saved_model import load_context -from keras.saving.legacy.saved_model import save as saved_model_save -from keras.saving.legacy.saved_model.utils import keras_option_scope -from keras.utils import io_utils -from keras.utils import traceback_utils +from tf_keras import backend +from tf_keras.saving import object_registration +from tf_keras.saving.legacy import hdf5_format +from tf_keras.saving.legacy import saving_utils +from tf_keras.saving.legacy import serialization +from tf_keras.saving.legacy.saved_model import load as saved_model_load +from tf_keras.saving.legacy.saved_model import load_context +from tf_keras.saving.legacy.saved_model import save as saved_model_save +from tf_keras.saving.legacy.saved_model.utils import keras_option_scope +from tf_keras.utils import io_utils +from tf_keras.utils import traceback_utils try: import h5py @@ -80,10 +80,10 @@ def save_model( __SavedModel serialization format__ - Keras SavedModel uses `tf.saved_model.save` to save the model and all + TF-Keras SavedModel uses `tf.saved_model.save` to save the model and all trackable objects attached to the model (e.g. layers and variables). The model config, weights, and optimizer are saved in the SavedModel. - Additionally, for every Keras layer attached to the model, the SavedModel + Additionally, for every TF-Keras layer attached to the model, the SavedModel stores: * the config and metadata -- e.g. name, dtype, trainable status @@ -101,7 +101,7 @@ def save_model( `tf.keras.models.load_model`. Args: - model: Keras model instance to be saved. + model: TF-Keras model instance to be saved. filepath: One of the following: - String or `pathlib.Path` object, path where to save the model - `h5py.File` object where to save the model @@ -128,7 +128,7 @@ def save_model( ImportError: If save format is hdf5, and h5py is not available. """ - from keras.engine import sequential + from tf_keras.engine import sequential default_format = "tf" if tf.__internal__.tf2.enabled() else "h5" save_format = save_format or default_format @@ -208,7 +208,7 @@ def load_model(filepath, custom_objects=None, compile=True, options=None): options for loading from SavedModel. Returns: - A Keras model instance. If the original model was compiled, and saved + A TF-Keras model instance. If the original model was compiled, and saved with the optimizer, then the returned model will be compiled. Otherwise, the model will be left uncompiled. In the case that an uncompiled model is returned, a warning is displayed if the `compile` argument is set to @@ -337,7 +337,7 @@ def save_weights( user_format = save_format.lower().strip() if user_format in ("tensorflow", "tf"): save_format = "tf" - elif user_format in ("hdf5", "h5", "keras"): + elif user_format in ("hdf5", "h5", "tf_keras"): save_format = "h5" else: raise ValueError( @@ -543,5 +543,5 @@ def _is_readable_tf_checkpoint(filepath): # Inject the load_model function to keras_deps to remove the dependency -# from TFLite to Keras. +# from TFLite to TF-Keras. tf.__internal__.register_load_model_function(load_model) diff --git a/keras/saving/legacy/save_test.py b/tf_keras/saving/legacy/save_test.py similarity index 98% rename from keras/saving/legacy/save_test.py rename to tf_keras/saving/legacy/save_test.py index b9ec7d5d7..71ddbff09 100644 --- a/keras/saving/legacy/save_test.py +++ b/tf_keras/saving/legacy/save_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras model saving code.""" +"""Tests for TF-Keras model saving code.""" import collections import os @@ -24,23 +24,23 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import losses -from keras import optimizers -from keras.engine import functional -from keras.engine import sequential -from keras.feature_column import dense_features -from keras.feature_column import sequence_feature_column as ksfc -from keras.layers import core -from keras.optimizers import optimizer_v1 -from keras.premade_models.linear import LinearModel -from keras.saving import object_registration -from keras.saving.legacy import model_config -from keras.saving.legacy import save -from keras.saving.legacy import serialization -from keras.saving.legacy.saved_model import utils as saved_model_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras import losses +from tf_keras import optimizers +from tf_keras.engine import functional +from tf_keras.engine import sequential +from tf_keras.feature_column import dense_features +from tf_keras.feature_column import sequence_feature_column as ksfc +from tf_keras.layers import core +from tf_keras.optimizers import optimizer_v1 +from tf_keras.premade_models.linear import LinearModel +from tf_keras.saving import object_registration +from tf_keras.saving.legacy import model_config +from tf_keras.saving.legacy import save +from tf_keras.saving.legacy import serialization +from tf_keras.saving.legacy.saved_model import utils as saved_model_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils try: import h5py @@ -478,7 +478,7 @@ def _assert_same_weights_and_metrics(self, model, loaded_model): if loaded_model.optimizer: if test_utils.get_save_format() == "tf": - # TODO(b/153110928): Keras TF format doesn't restore optimizer + # TODO(b/153110928): TF-Keras TF format doesn't restore optimizer # weights currently. return if isinstance( @@ -822,7 +822,7 @@ def test_saving_model_with_long_weights_names(self): ) model = keras.models.load_model(saved_model_dir) - if save_format in ["h5", "hdf5", "keras"]: + if save_format in ["h5", "hdf5", "tf_keras"]: # Check that the HDF5 files contains chunked array # of weight names. with h5py.File(saved_model_dir, "r") as h5file: diff --git a/keras/saving/legacy/save_weights_test.py b/tf_keras/saving/legacy/save_weights_test.py similarity index 99% rename from keras/saving/legacy/save_weights_test.py rename to tf_keras/saving/legacy/save_weights_test.py index fbfcea017..dc79ad997 100644 --- a/keras/saving/legacy/save_weights_test.py +++ b/tf_keras/saving/legacy/save_weights_test.py @@ -22,12 +22,12 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.engine import training -from keras.optimizers import optimizer_v1 -from keras.saving.legacy import hdf5_format -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.engine import training +from tf_keras.optimizers import optimizer_v1 +from tf_keras.saving.legacy import hdf5_format +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils try: import h5py diff --git a/keras/saving/legacy/saved_model/BUILD b/tf_keras/saving/legacy/saved_model/BUILD similarity index 76% rename from keras/saving/legacy/saved_model/BUILD rename to tf_keras/saving/legacy/saved_model/BUILD index ac954f803..c37562eda 100644 --- a/keras/saving/legacy/saved_model/BUILD +++ b/tf_keras/saving/legacy/saved_model/BUILD @@ -14,19 +14,19 @@ # ============================================================================== # Description: -# Keras saving and loading files for SavedModel. +# TF-Keras saving and loading files for SavedModel. # buildifier: disable=same-origin-load # Placeholder: load unaliased py_library # Placeholder: load unaliased py_binary -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras/layers/rnn:__pkg__", - "//keras/saving:__subpackages__", + "//tf_keras/layers/rnn:__pkg__", + "//tf_keras/saving:__subpackages__", ], licenses = ["notice"], ) @@ -47,8 +47,8 @@ py_library( srcs = ["utils.py"], deps = [ "//:expect_tensorflow_installed", - "//keras/engine:base_layer_utils", - "//keras/utils:layer_utils", + "//tf_keras/engine:base_layer_utils", + "//tf_keras/utils:layer_utils", ], ) @@ -73,7 +73,7 @@ py_library( ":order_preserving_set", ":utils", "//:expect_tensorflow_installed", - "//keras/utils:generic_utils", + "//tf_keras/utils:generic_utils", ], ) @@ -87,11 +87,11 @@ tf_py_test( "no_windows", # b/158005583 ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -102,11 +102,11 @@ tf_py_test( python_version = "PY3", deps = [ ":saved_model", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -117,18 +117,17 @@ tf_py_test( python_version = "PY3", shard_count = 4, tags = [ - "no_oss", # TODO(b/296236267) "no_pip", # TODO(b/202022379) "no_rocm", "no_windows", "notsan", #TODO(b/181771982): it is flaky ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -139,10 +138,10 @@ py_binary( srcs_version = "PY3", tags = ["no_oss"], deps = [ + "//:expect_absl_installed", # absl:app "//:expect_tensorflow_installed", - "//keras:regularizers", - "//keras/testing_infra:test_utils", - "//third_party/py/absl:app", + "//tf_keras:regularizers", + "//tf_keras/testing_infra:test_utils", "//third_party/py/absl/flags", ], ) diff --git a/keras/saving/legacy/saved_model/README.md b/tf_keras/saving/legacy/saved_model/README.md similarity index 85% rename from keras/saving/legacy/saved_model/README.md rename to tf_keras/saving/legacy/saved_model/README.md index b0bf81c6f..d52927c6e 100644 --- a/keras/saving/legacy/saved_model/README.md +++ b/tf_keras/saving/legacy/saved_model/README.md @@ -1,4 +1,4 @@ -# Keras SavedModel +# TF-Keras SavedModel For questions, feedback, and feature requests please file a bug/contact kathywu@ @@ -18,7 +18,7 @@ Please see the links below for more details: - [Saved Model Guide](https://www.tensorflow.org/guide/saved_model) - [Checkpoint Guide](https://www.tensorflow.org/guide/checkpoint) -## Keras SavedModel implementation +## TF-Keras SavedModel implementation ### Overview @@ -36,13 +36,13 @@ Trackable objects and TensorFlow functions are represented as nodes in the trackable object graph, and each node in the graph stores information about their python properties. -Since many attributes in Keras Layers/Models are not Trackable objects or +Since many attributes in TF-Keras Layers/Models are not Trackable objects or tf.functions, these attributes are wrapped as trackable objects/tf.functions at serialization time. For example, `layer.variables` is implemented as a python property that appends the lists of trainable/nontrainable variables. During serialization, a new Trackable List object is created and saved to the `variables` attribute. Another example is the call function. Most models do not -decorate their call function with `tf.function`, since Keras will take care of +decorate their call function with `tf.function`, since TF-Keras will take care of the graph/function management. When the model is saved, the call function is wrapped in a `tf.function` and added to the `__call__` attribute. @@ -52,13 +52,13 @@ wrapped in a `tf.function` and added to the `__call__` attribute. Many attributes are only relevant for revivability. Instead of attaching these directly to the exported object, they are saved to a new `keras_api` trackable object that is then attached to the exported object. This avoids cluttering the -exported object with objects/functions that are only used by the Keras library. +exported object with objects/functions that are only used by the TF-Keras library. For example, `__call__` and `call_and_return_conditional_losses` are functions saved for all models. The `__call__` function is attached directly to the exported object, while `call_and_return_conditional_losses` is attached to a separate object. Say a user saves the model, then loads the SavedModel using the -core loader (tf.saved_model.load which does not rely on the Keras library to +core loader (tf.saved_model.load which does not rely on the TF-Keras library to revive the model). The loaded object will have a structure that looks like: @@ -80,18 +80,18 @@ The two call functions may be accessed through: Keras Layers use a helper abstract class and an attribute validator class to define and standardize the serialization implementation: -- [`SerializationImpl`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/saving/saved_model/base_serialization.py): +- [`SerializationImpl`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tf_keras/saving/saved_model/base_serialization.py): Ensures that layer python properties are saved as a serialized JSON string in -the metadata field, and gathers all attributes to save with the Keras object. +the metadata field, and gathers all attributes to save with the TF-Keras object. Please see the docstrings in each of the abstract methods/properties to see what is required. -- [`SerializedAttributes`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/saving/saved_model/serialized_attributes.py?): -Tracks all of the attributes that must be saved with a Keras object. Objects and +- [`SerializedAttributes`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tf_keras/saving/saved_model/serialized_attributes.py?): +Tracks all of the attributes that must be saved with a TF-Keras object. Objects and functions may be specified to be "keras_only", meaning that they will only appear in the `keras_api` attribute. The base `Layer` serialization is defined in -[`layer_serialization.py`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/saving/saved_model/layer_serialization.py). +[`layer_serialization.py`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tf_keras/saving/saved_model/layer_serialization.py). See `LayerAttributes` and `LayerSerializationImpl`. **Adding a new attribute to base Layer SavedModel** @@ -118,9 +118,9 @@ Unless you are modifying the loader (see section below on loading), please keep the `object_identifier` the same. These instructions also carry over for modifying -[Model](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/saving/saved_model/model_serialization.py) +[Model](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tf_keras/saving/saved_model/model_serialization.py) and -[Network](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/saving/saved_model/network_serialization.py) +[Network](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tf_keras/saving/saved_model/network_serialization.py) serialization. diff --git a/keras/saving/legacy/saved_model/__init__.py b/tf_keras/saving/legacy/saved_model/__init__.py similarity index 100% rename from keras/saving/legacy/saved_model/__init__.py rename to tf_keras/saving/legacy/saved_model/__init__.py diff --git a/keras/saving/legacy/saved_model/base_serialization.py b/tf_keras/saving/legacy/saved_model/base_serialization.py similarity index 97% rename from keras/saving/legacy/saved_model/base_serialization.py rename to tf_keras/saving/legacy/saved_model/base_serialization.py index 51057c084..53d67ab11 100644 --- a/keras/saving/legacy/saved_model/base_serialization.py +++ b/tf_keras/saving/legacy/saved_model/base_serialization.py @@ -21,8 +21,8 @@ import abc -from keras.saving.legacy.saved_model import json_utils -from keras.saving.legacy.saved_model import utils +from tf_keras.saving.legacy.saved_model import json_utils +from tf_keras.saving.legacy.saved_model import utils class SavedModelSaver(object, metaclass=abc.ABCMeta): @@ -91,7 +91,7 @@ def objects_to_serialize(self, serialization_cache): @abc.abstractmethod def functions_to_serialize(self, serialization_cache): - """Returns extra functions to include when serializing a Keras object. + """Returns extra functions to include when serializing a TF-Keras object. Normally, when calling exporting an object to SavedModel, only the functions and objects defined by the user are saved. For example: diff --git a/keras/saving/legacy/saved_model/constants.py b/tf_keras/saving/legacy/saved_model/constants.py similarity index 91% rename from keras/saving/legacy/saved_model/constants.py rename to tf_keras/saving/legacy/saved_model/constants.py index c50558631..7d5701db0 100644 --- a/keras/saving/legacy/saved_model/constants.py +++ b/tf_keras/saving/legacy/saved_model/constants.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Constants for Keras SavedModel serialization.""" +"""Constants for TF-Keras SavedModel serialization.""" # Namespace used to store all attributes added during serialization. # e.g. the list of layers can be accessed using `loaded.keras_api.layers`, in an @@ -24,10 +24,10 @@ KERAS_CACHE_KEY = "keras_serialized_attributes" -# Name of Keras metadata file stored in the SavedModel. +# Name of TF-Keras metadata file stored in the SavedModel. SAVED_METADATA_PATH = "keras_metadata.pb" -# Names of SavedObject Keras identifiers. +# Names of SavedObject TF-Keras identifiers. INPUT_LAYER_IDENTIFIER = "_tf_keras_input_layer" LAYER_IDENTIFIER = "_tf_keras_layer" METRIC_IDENTIFIER = "_tf_keras_metric" diff --git a/keras/saving/legacy/saved_model/create_test_saved_model.py b/tf_keras/saving/legacy/saved_model/create_test_saved_model.py similarity index 92% rename from keras/saving/legacy/saved_model/create_test_saved_model.py rename to tf_keras/saving/legacy/saved_model/create_test_saved_model.py index 5a281df9c..df584ff96 100644 --- a/keras/saving/legacy/saved_model/create_test_saved_model.py +++ b/tf_keras/saving/legacy/saved_model/create_test_saved_model.py @@ -8,8 +8,8 @@ from absl import app from absl import flags -from keras import regularizers -from keras.testing_infra import test_utils +from tf_keras import regularizers +from tf_keras.testing_infra import test_utils flags.DEFINE_string("output_path", "", "The path to write the SavedModel at.") diff --git a/keras/saving/legacy/saved_model/determinism_test.py b/tf_keras/saving/legacy/saved_model/determinism_test.py similarity index 100% rename from keras/saving/legacy/saved_model/determinism_test.py rename to tf_keras/saving/legacy/saved_model/determinism_test.py diff --git a/keras/saving/legacy/saved_model/json_utils.py b/tf_keras/saving/legacy/saved_model/json_utils.py similarity index 96% rename from keras/saving/legacy/saved_model/json_utils.py rename to tf_keras/saving/legacy/saved_model/json_utils.py index 05b0e285b..f9d35c222 100644 --- a/keras/saving/legacy/saved_model/json_utils.py +++ b/tf_keras/saving/legacy/saved_model/json_utils.py @@ -30,9 +30,9 @@ import tensorflow.compat.v2 as tf import wrapt -from keras.saving import serialization_lib -from keras.saving.legacy import serialization -from keras.saving.legacy.saved_model.utils import in_tf_saved_model_scope +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy import serialization +from tf_keras.saving.legacy.saved_model.utils import in_tf_saved_model_scope # isort: off from tensorflow.python.framework import type_spec_registry @@ -76,7 +76,7 @@ def decode(json_string): def decode_and_deserialize( json_string, module_objects=None, custom_objects=None ): - """Decodes the JSON and deserializes any Keras objects found in the dict.""" + """Decodes the JSON and deserializes any TF-Keras objects found in the dict.""" return json.loads( json_string, object_hook=functools.partial( @@ -162,7 +162,7 @@ def get_json_type(obj): Raises: TypeError: if `obj` cannot be serialized. """ - # if obj is a serializable Keras class instance + # if obj is a serializable TF-Keras class instance # e.g. optimizer, layer if hasattr(obj, "get_config"): serialized = serialization.serialize_keras_object(obj) diff --git a/keras/saving/legacy/saved_model/json_utils_test.py b/tf_keras/saving/legacy/saved_model/json_utils_test.py similarity index 95% rename from keras/saving/legacy/saved_model/json_utils_test.py rename to tf_keras/saving/legacy/saved_model/json_utils_test.py index 3a86aad31..8dca963fa 100644 --- a/keras/saving/legacy/saved_model/json_utils_test.py +++ b/tf_keras/saving/legacy/saved_model/json_utils_test.py @@ -19,9 +19,9 @@ import tensorflow.compat.v2 as tf -from keras.saving.legacy.saved_model import json_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras.saving.legacy.saved_model import json_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class JsonUtilsTest(test_combinations.TestCase): diff --git a/keras/saving/legacy/saved_model/layer_serialization.py b/tf_keras/saving/legacy/saved_model/layer_serialization.py similarity index 95% rename from keras/saving/legacy/saved_model/layer_serialization.py rename to tf_keras/saving/legacy/saved_model/layer_serialization.py index ae7e320a0..331236bb6 100644 --- a/keras/saving/legacy/saved_model/layer_serialization.py +++ b/tf_keras/saving/legacy/saved_model/layer_serialization.py @@ -16,12 +16,12 @@ import tensorflow.compat.v2 as tf -from keras.mixed_precision import policy -from keras.saving.legacy import serialization -from keras.saving.legacy.saved_model import base_serialization -from keras.saving.legacy.saved_model import constants -from keras.saving.legacy.saved_model import save_impl -from keras.saving.legacy.saved_model import serialized_attributes +from tf_keras.mixed_precision import policy +from tf_keras.saving.legacy import serialization +from tf_keras.saving.legacy.saved_model import base_serialization +from tf_keras.saving.legacy.saved_model import constants +from tf_keras.saving.legacy.saved_model import save_impl +from tf_keras.saving.legacy.saved_model import serialized_attributes class LayerSavedModelSaver(base_serialization.SavedModelSaver): diff --git a/keras/saving/legacy/saved_model/load.py b/tf_keras/saving/legacy/saved_model/load.py similarity index 95% rename from keras/saving/legacy/saved_model/load.py rename to tf_keras/saving/legacy/saved_model/load.py index ffc4bad14..bca63a59d 100644 --- a/keras/saving/legacy/saved_model/load.py +++ b/tf_keras/saving/legacy/saved_model/load.py @@ -22,26 +22,26 @@ import tensorflow.compat.v2 as tf from google.protobuf import message -from keras import backend -from keras import regularizers -from keras.engine import input_spec -from keras.optimizers.legacy import optimizer_v2 -from keras.protobuf import saved_metadata_pb2 -from keras.protobuf import versions_pb2 -from keras.saving import object_registration -from keras.saving.legacy import model_config -from keras.saving.legacy import saving_utils -from keras.saving.legacy import serialization -from keras.saving.legacy.saved_model import constants -from keras.saving.legacy.saved_model import json_utils -from keras.saving.legacy.saved_model import utils -from keras.saving.legacy.saved_model.serialized_attributes import ( +from tf_keras import backend +from tf_keras import regularizers +from tf_keras.engine import input_spec +from tf_keras.optimizers.legacy import optimizer_v2 +from tf_keras.protobuf import saved_metadata_pb2 +from tf_keras.protobuf import versions_pb2 +from tf_keras.saving import object_registration +from tf_keras.saving.legacy import model_config +from tf_keras.saving.legacy import saving_utils +from tf_keras.saving.legacy import serialization +from tf_keras.saving.legacy.saved_model import constants +from tf_keras.saving.legacy.saved_model import json_utils +from tf_keras.saving.legacy.saved_model import utils +from tf_keras.saving.legacy.saved_model.serialized_attributes import ( CommonEndpoints, ) -from keras.utils import layer_utils -from keras.utils import metrics_utils -from keras.utils import tf_inspect -from keras.utils.generic_utils import LazyLoader +from tf_keras.utils import layer_utils +from tf_keras.utils import metrics_utils +from tf_keras.utils import tf_inspect +from tf_keras.utils.generic_utils import LazyLoader # To avoid circular dependencies between keras/engine and keras/saving, # code in keras/saving must delay imports. @@ -49,19 +49,19 @@ # TODO(b/134426265): Switch back to single-quotes to match the rest of the file # once the issue with copybara is fixed. -models_lib = LazyLoader("models_lib", globals(), "keras.models") -base_layer = LazyLoader("base_layer", globals(), "keras.engine.base_layer") -layers_module = LazyLoader("layers_module", globals(), "keras.layers") -input_layer = LazyLoader("input_layer", globals(), "keras.engine.input_layer") +models_lib = LazyLoader("models_lib", globals(), "tf_keras.models") +base_layer = LazyLoader("base_layer", globals(), "tf_keras.engine.base_layer") +layers_module = LazyLoader("layers_module", globals(), "tf_keras.layers") +input_layer = LazyLoader("input_layer", globals(), "tf_keras.engine.input_layer") functional_lib = LazyLoader( - "functional_lib", globals(), "keras.engine.functional" + "functional_lib", globals(), "tf_keras.engine.functional" ) -training_lib = LazyLoader("training_lib", globals(), "keras.engine.training") +training_lib = LazyLoader("training_lib", globals(), "tf_keras.engine.training") training_lib_v1 = LazyLoader( - "training_lib_v1", globals(), "keras.engine.training_v1" + "training_lib_v1", globals(), "tf_keras.engine.training_v1" ) -metrics = LazyLoader("metrics", globals(), "keras.metrics") -base_rnn = LazyLoader("base_rnn", globals(), "keras.layers.rnn.base_rnn") +metrics = LazyLoader("metrics", globals(), "tf_keras.metrics") +base_rnn = LazyLoader("base_rnn", globals(), "tf_keras.layers.rnn.base_rnn") PUBLIC_ATTRIBUTES = CommonEndpoints.all_functions.union( @@ -71,13 +71,13 @@ def load(path, compile=True, options=None): - """Loads Keras objects from a SavedModel. + """Loads TF-Keras objects from a SavedModel. - Any Keras layer or model saved to the SavedModel will be loaded back - as Keras objects. Other objects are loaded as regular trackable objects + Any TF-Keras layer or model saved to the SavedModel will be loaded back + as TF-Keras objects. Other objects are loaded as regular trackable objects (same as `tf.saved_model.load`). - Currently, Keras saving/loading only retains the Keras object's weights, + Currently, TF-Keras saving/loading only retains the TF-Keras object's weights, losses, and call function. The loaded model can be re-compiled, but the original optimizer, compiled @@ -125,7 +125,7 @@ def load(path, compile=True, options=None): _read_legacy_metadata(object_graph_def, metadata, path) if not metadata.nodes: - # When there are no Keras objects, return the results from the core + # When there are no TF-Keras objects, return the results from the core # loader return tf.saved_model.load(path, options=options) @@ -222,10 +222,10 @@ def _read_legacy_metadata(object_graph_def, metadata, path): ): if not proto.user_object.metadata: raise ValueError( - "Unable to create a Keras model from SavedModel at " + "Unable to create a TF-Keras model from SavedModel at " f"{path}. This SavedModel was exported with " - "`tf.saved_model.save`, and lacks the Keras metadata file. " - "Please save your Keras model by calling `model.save` " + "`tf.saved_model.save`, and lacks the TF-Keras metadata file. " + "Please save your TF-Keras model by calling `model.save` " "or `tf.keras.models.save_model`. Note that " "you can still load this SavedModel with " "`tf.saved_model.load`." @@ -272,7 +272,7 @@ def _is_graph_network(layer): class KerasObjectLoader: - """Loader that recreates Keras objects (e.g. + """Loader that recreates TF-Keras objects (e.g. layers, models). @@ -694,7 +694,7 @@ def get_path(self, node_id): return self._node_paths[node_id] def finalize_objects(self): - """Finish setting up Keras objects. + """Finish setting up TF-Keras objects. This function is executed after all objects and functions have been created. Call functions and losses are attached to each layer, and once @@ -922,7 +922,7 @@ def setattr_wrapper(obj, name, value): def _finalize_saved_model_layers(layers): - """Runs the final steps of loading Keras Layers from SavedModel.""" + """Runs the final steps of loading TF-Keras Layers from SavedModel.""" # 1. Set up call functions for all layers initialized from the SavedModel ( # and not the config) @@ -1000,7 +1000,7 @@ def _unable_to_call_layer_due_to_serialization_issue( ): """Replaces the `layer.call` if the layer was not fully serialized. - Keras Model/Layer serialization is relatively relaxed because SavedModels + TF-Keras Model/Layer serialization is relatively relaxed because SavedModels are not always loaded back as keras models. Thus, when there is an issue tracing a non-signature function, a warning is logged instead of raising an error. This results in a SavedModel where the model's call function is @@ -1024,7 +1024,7 @@ def _unable_to_call_layer_due_to_serialization_issue( "\n\n(1) Implement `get_config` and `from_config` in the layer/model " "class, and pass the object to the `custom_objects` argument when " "loading the model. For more details, see: " - "https://www.tensorflow.org/guide/keras/save_and_serialize" + "https://www.tensorflow.org/guide/tf_keras/save_and_serialize" "\n\n(2) Ensure that the subclassed model or layer overwrites `call` " "and not `__call__`. The input shape and dtype will be automatically " "recorded when the object is called, and used when saving. To manually " @@ -1034,7 +1034,7 @@ def _unable_to_call_layer_due_to_serialization_issue( def _finalize_config_layers(layers): - """Runs the final steps of loading Keras Layers from config.""" + """Runs the final steps of loading TF-Keras Layers from config.""" for layer in layers: # It is assumed that layers define their unconditional losses after # being recreated from the config and built. The exceptions to this are @@ -1271,7 +1271,7 @@ def get_config(self): def recursively_deserialize_keras_object(config, module_objects=None): - """Deserialize Keras object from a nested structure.""" + """Deserialize TF-Keras object from a nested structure.""" if isinstance(config, dict): if "class_name" in config: return serialization.deserialize_keras_object( @@ -1291,7 +1291,7 @@ def recursively_deserialize_keras_object(config, module_objects=None): ] else: raise ValueError( - "Unable to decode Keras layer config. Config should be a " + "Unable to decode TF-Keras layer config. Config should be a " f"dictionary, tuple or list. Received: config={config}" ) diff --git a/keras/saving/legacy/saved_model/load_context.py b/tf_keras/saving/legacy/saved_model/load_context.py similarity index 100% rename from keras/saving/legacy/saved_model/load_context.py rename to tf_keras/saving/legacy/saved_model/load_context.py diff --git a/keras/saving/legacy/saved_model/metric_serialization.py b/tf_keras/saving/legacy/saved_model/metric_serialization.py similarity index 90% rename from keras/saving/legacy/saved_model/metric_serialization.py rename to tf_keras/saving/legacy/saved_model/metric_serialization.py index 4d032ca28..737d1a364 100644 --- a/keras/saving/legacy/saved_model/metric_serialization.py +++ b/tf_keras/saving/legacy/saved_model/metric_serialization.py @@ -16,9 +16,9 @@ import tensorflow.compat.v2 as tf -from keras.saving import object_registration -from keras.saving.legacy.saved_model import constants -from keras.saving.legacy.saved_model import layer_serialization +from tf_keras.saving import object_registration +from tf_keras.saving.legacy.saved_model import constants +from tf_keras.saving.legacy.saved_model import layer_serialization class MetricSavedModelSaver(layer_serialization.LayerSavedModelSaver): diff --git a/keras/saving/legacy/saved_model/model_serialization.py b/tf_keras/saving/legacy/saved_model/model_serialization.py similarity index 91% rename from keras/saving/legacy/saved_model/model_serialization.py rename to tf_keras/saving/legacy/saved_model/model_serialization.py index 991b92d92..11244b8ee 100644 --- a/keras/saving/legacy/saved_model/model_serialization.py +++ b/tf_keras/saving/legacy/saved_model/model_serialization.py @@ -14,10 +14,10 @@ # ============================================================================== """Classes and functions implementing to Model SavedModel serialization.""" -from keras.saving.legacy import saving_utils -from keras.saving.legacy.saved_model import constants -from keras.saving.legacy.saved_model import layer_serialization -from keras.saving.legacy.saved_model import save_impl +from tf_keras.saving.legacy import saving_utils +from tf_keras.saving.legacy.saved_model import constants +from tf_keras.saving.legacy.saved_model import layer_serialization +from tf_keras.saving.legacy.saved_model import save_impl class ModelSavedModelSaver(layer_serialization.LayerSavedModelSaver): diff --git a/keras/saving/legacy/saved_model/network_serialization.py b/tf_keras/saving/legacy/saved_model/network_serialization.py similarity index 89% rename from keras/saving/legacy/saved_model/network_serialization.py rename to tf_keras/saving/legacy/saved_model/network_serialization.py index dfc2ba335..3edbc98b6 100644 --- a/keras/saving/legacy/saved_model/network_serialization.py +++ b/tf_keras/saving/legacy/saved_model/network_serialization.py @@ -14,8 +14,8 @@ # ============================================================================== """Classes and functions implementing to Network SavedModel serialization.""" -from keras.saving.legacy.saved_model import constants -from keras.saving.legacy.saved_model import model_serialization +from tf_keras.saving.legacy.saved_model import constants +from tf_keras.saving.legacy.saved_model import model_serialization # FunctionalModel serialization is pretty much the same as Model serialization. diff --git a/keras/saving/legacy/saved_model/order_preserving_set.py b/tf_keras/saving/legacy/saved_model/order_preserving_set.py similarity index 100% rename from keras/saving/legacy/saved_model/order_preserving_set.py rename to tf_keras/saving/legacy/saved_model/order_preserving_set.py diff --git a/keras/saving/legacy/saved_model/revive_test.py b/tf_keras/saving/legacy/saved_model/revive_test.py similarity index 97% rename from keras/saving/legacy/saved_model/revive_test.py rename to tf_keras/saving/legacy/saved_model/revive_test.py index 4a134fc82..500ead215 100644 --- a/keras/saving/legacy/saved_model/revive_test.py +++ b/tf_keras/saving/legacy/saved_model/revive_test.py @@ -26,12 +26,12 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import backend -from keras.saving.legacy.saved_model import load as keras_load -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import CustomObjectScope +import tf_keras as keras +from tf_keras import backend +from tf_keras.saving.legacy.saved_model import load as keras_load +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import CustomObjectScope class SubclassedModelNoConfig(keras.Model): @@ -192,7 +192,7 @@ def get_config(self): return {} -# The WideDeepModel, whose name conflicts with a Keras built-in model, is +# The WideDeepModel, whose name conflicts with a TF-Keras built-in model, is # registered in these tests. class WideDeepModel(SubclassedModelWithConfig): pass diff --git a/keras/saving/legacy/saved_model/save.py b/tf_keras/saving/legacy/saved_model/save.py similarity index 87% rename from keras/saving/legacy/saved_model/save.py rename to tf_keras/saving/legacy/saved_model/save.py index 9126275cf..146a83668 100644 --- a/keras/saving/legacy/saved_model/save.py +++ b/tf_keras/saving/legacy/saved_model/save.py @@ -19,16 +19,16 @@ import tensorflow.compat.v2 as tf from absl import logging -from keras import backend -from keras.protobuf import saved_metadata_pb2 -from keras.protobuf import versions_pb2 -from keras.saving.legacy import saving_utils -from keras.saving.legacy import serialization -from keras.saving.legacy.saved_model import constants -from keras.saving.legacy.saved_model import save_impl -from keras.saving.legacy.saved_model import utils -from keras.utils.generic_utils import LazyLoader -from keras.utils.io_utils import ask_to_proceed_with_overwrite +from tf_keras import backend +from tf_keras.protobuf import saved_metadata_pb2 +from tf_keras.protobuf import versions_pb2 +from tf_keras.saving.legacy import saving_utils +from tf_keras.saving.legacy import serialization +from tf_keras.saving.legacy.saved_model import constants +from tf_keras.saving.legacy.saved_model import save_impl +from tf_keras.saving.legacy.saved_model import utils +from tf_keras.utils.generic_utils import LazyLoader +from tf_keras.utils.io_utils import ask_to_proceed_with_overwrite # isort: off from tensorflow.python.saved_model import save as save_lib @@ -36,8 +36,8 @@ # To avoid circular dependencies between keras/engine and keras/saving, # code in keras/saving must delay imports. -base_layer = LazyLoader("base_layer", globals(), "keras.engine.base_layer") -training_lib = LazyLoader("training_lib", globals(), "keras.engine.training") +base_layer = LazyLoader("base_layer", globals(), "tf_keras.engine.base_layer") +training_lib = LazyLoader("training_lib", globals(), "tf_keras.engine.training") def save( @@ -52,7 +52,7 @@ def save( """Saves a model as a SavedModel to the filepath. Args: - model: Keras model instance to be saved. + model: TF-Keras model instance to be saved. filepath: String path to save the model. overwrite: whether to overwrite the existing filepath. include_optimizer: If True, save the model's optimizer state. @@ -135,13 +135,13 @@ def generate_keras_metadata(saved_nodes, node_paths): # Log warning if the node's class name conflicts with a Keras # built-in object. class_name = node.__class__.__name__ - from keras.layers import serialization as layers_serialization + from tf_keras.layers import serialization as layers_serialization builtin_layer = layers_serialization.get_builtin_layer(class_name) if builtin_layer: if not isinstance(node, builtin_layer): logging.warning( - "%s has the same name '%s' as a built-in Keras " + "%s has the same name '%s' as a built-in TF-Keras " "object. Consider renaming %s to avoid naming " "conflicts when loading with " "`tf.keras.models.load_model`. " diff --git a/keras/saving/legacy/saved_model/save_impl.py b/tf_keras/saving/legacy/saved_model/save_impl.py similarity index 95% rename from keras/saving/legacy/saved_model/save_impl.py rename to tf_keras/saving/legacy/saved_model/save_impl.py index a3e769c47..cb3626037 100644 --- a/keras/saving/legacy/saved_model/save_impl.py +++ b/tf_keras/saving/legacy/saved_model/save_impl.py @@ -25,20 +25,20 @@ import tensorflow.compat.v1.logging as logging import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer_utils -from keras.engine import input_spec -from keras.mixed_precision import autocast_variable -from keras.saving.legacy import saving_utils -from keras.saving.legacy.saved_model import constants -from keras.saving.legacy.saved_model import load as keras_load -from keras.saving.legacy.saved_model import serialized_attributes -from keras.saving.legacy.saved_model import utils -from keras.utils import layer_utils -from keras.utils import tf_contextlib -from keras.utils import tf_utils -from keras.utils import version_utils -from keras.utils.generic_utils import LazyLoader +from tf_keras import backend +from tf_keras.engine import base_layer_utils +from tf_keras.engine import input_spec +from tf_keras.mixed_precision import autocast_variable +from tf_keras.saving.legacy import saving_utils +from tf_keras.saving.legacy.saved_model import constants +from tf_keras.saving.legacy.saved_model import load as keras_load +from tf_keras.saving.legacy.saved_model import serialized_attributes +from tf_keras.saving.legacy.saved_model import utils +from tf_keras.utils import layer_utils +from tf_keras.utils import tf_contextlib +from tf_keras.utils import tf_utils +from tf_keras.utils import version_utils +from tf_keras.utils.generic_utils import LazyLoader # To avoid circular dependencies between keras/engine and keras/saving, # code in keras/saving must delay imports. @@ -46,12 +46,12 @@ # TODO(b/134426265): Switch back to single-quotes to match the rest of the file # once the issue with copybara is fixed. -base_layer = LazyLoader("base_layer", globals(), "keras.engine.base_layer") -metrics = LazyLoader("metrics", globals(), "keras.metrics") -input_layer = LazyLoader("input_layer", globals(), "keras.engine.input_layer") -training_lib = LazyLoader("training_lib", globals(), "keras.engine.training") +base_layer = LazyLoader("base_layer", globals(), "tf_keras.engine.base_layer") +metrics = LazyLoader("metrics", globals(), "tf_keras.metrics") +input_layer = LazyLoader("input_layer", globals(), "tf_keras.engine.input_layer") +training_lib = LazyLoader("training_lib", globals(), "tf_keras.engine.training") sequential_lib = LazyLoader( - "sequential_lib", globals(), "keras.engine.sequential" + "sequential_lib", globals(), "tf_keras.engine.sequential" ) @@ -64,7 +64,7 @@ def should_skip_serialization(layer): ) if not layer.built and not saved_model_input_spec_set: logging.warning( - "Skipping full serialization of Keras layer {}, because " + "Skipping full serialization of TF-Keras layer {}, because " "it is not built.".format(layer) ) return True @@ -79,7 +79,7 @@ def wrap_layer_objects(layer, serialization_cache): """Returns extra trackable objects to attach to the serialized layer. Args: - layer: Keras Layer object. + layer: TF-Keras Layer object. serialization_cache: Dictionary shared between all objects during serialization. @@ -117,8 +117,8 @@ def wrap_layer_objects(layer, serialization_cache): # Avoid duplicate creation of shard Variables on loading. # `layer.variables` will return the shard Variables rather than the - # ShardedVariables (b/224541446), but Keras loading will create new - # ShardedVariables (and thus shard Variables) from Keras metadata if needed. + # ShardedVariables (b/224541446), but TF-Keras loading will create new + # ShardedVariables (and thus shard Variables) from TF-Keras metadata if needed. # There's no need to also save the shard Variables here, so filter them out. variables = _filter_shards(layer.variables) trainable_variables = _filter_shards(layer.trainable_variables) @@ -145,7 +145,7 @@ def wrap_layer_functions(layer, serialization_cache): """Returns dict of wrapped layer call function and losses in tf.functions. Args: - layer: Keras Layer object. + layer: TF-Keras Layer object. serialization_cache: Dictionary shared between all objects during serialization. @@ -247,7 +247,7 @@ def _replace_child_layer_functions(layer, serialization_cache): the original attributes. Args: - layer: Keras Layer object. + layer: TF-Keras Layer object. serialization_cache: Dictionary shared between all objects during serialization. @@ -684,7 +684,7 @@ def _wrap_call_and_conditional_losses(layer): separately. Args: - layer: a Keras layer object + layer: a TF-Keras layer object Returns: python call function that returns outputs and conditional losses -- diff --git a/keras/saving/legacy/saved_model/saved_model_test.py b/tf_keras/saving/legacy/saved_model/saved_model_test.py similarity index 98% rename from keras/saving/legacy/saved_model/saved_model_test.py rename to tf_keras/saving/legacy/saved_model/saved_model_test.py index 7ae947436..459254bff 100644 --- a/keras/saving/legacy/saved_model/saved_model_test.py +++ b/tf_keras/saving/legacy/saved_model/saved_model_test.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== -"""Tests for saving and loading Keras models and layers from SavedModel. +"""Tests for saving and loading TF-Keras models and layers from SavedModel. These should ensure that all layer properties are correctly assigned after loading from the SavedModel. @@ -31,21 +31,21 @@ from tensorflow.core.example import example_pb2 from tensorflow.core.example import feature_pb2 -import keras -from keras import regularizers -from keras.feature_column.dense_features import DenseFeatures -from keras.protobuf import saved_metadata_pb2 -from keras.protobuf import versions_pb2 -from keras.saving import object_registration -from keras.saving.legacy.saved_model import json_utils -from keras.saving.legacy.saved_model import load as keras_load -from keras.saving.legacy.saved_model import save_impl as keras_save -from keras.saving.legacy.saved_model import utils as saved_model_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import control_flow_util -from keras.utils import tf_contextlib -from keras.utils import tf_inspect +import tf_keras as keras +from tf_keras import regularizers +from tf_keras.feature_column.dense_features import DenseFeatures +from tf_keras.protobuf import saved_metadata_pb2 +from tf_keras.protobuf import versions_pb2 +from tf_keras.saving import object_registration +from tf_keras.saving.legacy.saved_model import json_utils +from tf_keras.saving.legacy.saved_model import load as keras_load +from tf_keras.saving.legacy.saved_model import save_impl as keras_save +from tf_keras.saving.legacy.saved_model import utils as saved_model_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import control_flow_util +from tf_keras.utils import tf_contextlib +from tf_keras.utils import tf_inspect class LayerWithLearningPhase(keras.engine.base_layer.Layer): @@ -692,7 +692,7 @@ def call(self, inputs): model.save(saved_model_dir, save_format="tf") load = tf.saved_model.load(saved_model_dir) - # Ensure that the Keras loader is able to load and build the model. + # Ensure that the TF-Keras loader is able to load and build the model. _ = keras_load.load(saved_model_dir) assert_training_default(load.__call__, False) @@ -731,7 +731,7 @@ def call(self, inputs, keyword=None): loaded_without_scope.predict(np.ones([1, 3]).astype("float32")) def testFeatureColumns(self): - # TODO(b/120099662): Error with table initialization with Keras models + # TODO(b/120099662): Error with table initialization with TF-Keras models # in graph mode. if tf.executing_eagerly(): numeric = tf.feature_column.numeric_column("a") @@ -931,7 +931,7 @@ def testSaveStatefulRNN(self, unroll): def testSaveBidirectionalLSTM(self): # Make sure that the input spec of an unrolled RNN is not used when # wrapped in a Bidirectional layer. - # https://github.com/keras-team/keras/issues/15454 + # https://github.com/keras-team/tf-keras/issues/15454 input_layer = keras.Input( batch_input_shape=(1, 15, 128), name="input", dtype=tf.float32 ) @@ -1230,7 +1230,7 @@ def test_load_non_keras_saved_model(self): saved_model_dir = self._save_model_dir() tf.saved_model.save(model, saved_model_dir) with self.assertRaisesRegex( - ValueError, "Unable to create a Keras model" + ValueError, "Unable to create a TF-Keras model" ): keras_load.load(saved_model_dir) diff --git a/keras/saving/legacy/saved_model/serialized_attributes.py b/tf_keras/saving/legacy/saved_model/serialized_attributes.py similarity index 92% rename from keras/saving/legacy/saved_model/serialized_attributes.py rename to tf_keras/saving/legacy/saved_model/serialized_attributes.py index 6780ad669..b12ee912d 100644 --- a/keras/saving/legacy/saved_model/serialized_attributes.py +++ b/tf_keras/saving/legacy/saved_model/serialized_attributes.py @@ -17,32 +17,32 @@ import tensorflow.compat.v2 as tf -from keras.saving.legacy.saved_model import constants -from keras.saving.legacy.saved_model import order_preserving_set as ops -from keras.saving.legacy.saved_model import save_impl -from keras.utils.generic_utils import LazyLoader +from tf_keras.saving.legacy.saved_model import constants +from tf_keras.saving.legacy.saved_model import order_preserving_set as ops +from tf_keras.saving.legacy.saved_model import save_impl +from tf_keras.utils.generic_utils import LazyLoader # TODO(b/134426265): Switch back to single-quotes to match the rest of the file # once the issue with copybara is fixed. -base_layer = LazyLoader("base_layer", globals(), "keras.engine.base_layer") -training_lib = LazyLoader("training_lib", globals(), "keras.engine.training") -metrics = LazyLoader("metrics", globals(), "keras.metrics") -base_rnn = LazyLoader("base_rnn", globals(), "keras.layers.rnn.base_rnn") +base_layer = LazyLoader("base_layer", globals(), "tf_keras.engine.base_layer") +training_lib = LazyLoader("training_lib", globals(), "tf_keras.engine.training") +metrics = LazyLoader("metrics", globals(), "tf_keras.metrics") +base_rnn = LazyLoader("base_rnn", globals(), "tf_keras.layers.rnn.base_rnn") class SerializedAttributes: """Class that tracks and validates all serialization attributes. - Keras models contain many Python-defined components. For example, the + TF-Keras models contain many Python-defined components. For example, the trainable_variable property lists the model's trainable variables by recursively retrieving the trainable variables from each of the child layers. Another example is model.call, a python function that calls child layers and adds ops to the backend graph. Only Tensorflow checkpointable objects and functions can be serialized to - SavedModel. Serializing a Keras model as-is results in a checkpointable - object that does not resemble a Keras model at all. Thus, extra + SavedModel. Serializing a TF-Keras model as-is results in a checkpointable + object that does not resemble a TF-Keras model at all. Thus, extra checkpointable objects and functions must be created during serialization. **Defining new serialized attributes** @@ -66,7 +66,7 @@ class SerializedAttributes: class: - CommonEndpoints: Base attributes to be added during serialization. If these attributes are present in a Trackable object, it can be - deserialized to a Keras Model. + deserialized to a TF-Keras Model. - LayerAttributes: Attributes to serialize for Layer objects. - ModelAttributes: Attributes to serialize for Model objects. 2. Update class docstring @@ -127,7 +127,7 @@ class will copy checkpoint objects/functions from each subclass. functions.extend(cls.all_functions) # OrderPreservingSets are used here to guarantee serialization - # determinism of Keras objects. + # determinism of TF-Keras objects. classdict = { "all_checkpointable_objects": ops.OrderPreservingSet( checkpointable_objects @@ -149,7 +149,7 @@ def new(obj): return LayerAttributes() else: raise TypeError( - "Internal error during serialization. Expected Keras " + "Internal error during serialization. Expected TF-Keras " f"Layer object. Received: {obj} " f"(of type {type(obj)})" ) @@ -249,7 +249,7 @@ def set_and_validate_objects(self, object_dict): "The object dictionary contained a non-trackable " f"object: {object_dict[key]} (for key {key}). " "Only trackable objects are " - "allowed, such as Keras layers/models or " + "allowed, such as TF-Keras layers/models or " "tf.Module instances." ) self._object_dict[key] = object_dict[key] @@ -276,7 +276,7 @@ class CommonEndpoints( ], ) ): - """Common endpoints shared by all models loadable by Keras. + """Common endpoints shared by all models loadable by TF-Keras. List of all attributes: variables: List of all variables in the model and its sublayers. @@ -289,7 +289,7 @@ class CommonEndpoints( call_and_return_all_conditional_losses: Function that returns a tuple of (call function outputs, list of all losses that depend on the inputs). _default_save_signature: Traced model call function. This is only included - if the top level exported object is a Keras model. + if the top level exported object is a TF-Keras model. """ diff --git a/keras/saving/legacy/saved_model/utils.py b/tf_keras/saving/legacy/saved_model/utils.py similarity index 96% rename from keras/saving/legacy/saved_model/utils.py rename to tf_keras/saving/legacy/saved_model/utils.py index 62c49f778..6e362c2e8 100644 --- a/keras/saving/legacy/saved_model/utils.py +++ b/tf_keras/saving/legacy/saved_model/utils.py @@ -22,14 +22,14 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer_utils -from keras.utils import control_flow_util -from keras.utils import tf_contextlib -from keras.utils.generic_utils import LazyLoader -from keras.utils.layer_utils import CallFunctionSpec +from tf_keras import backend +from tf_keras.engine import base_layer_utils +from tf_keras.utils import control_flow_util +from tf_keras.utils import tf_contextlib +from tf_keras.utils.generic_utils import LazyLoader +from tf_keras.utils.layer_utils import CallFunctionSpec -training_lib = LazyLoader("training_lib", globals(), "keras.engine.training") +training_lib = LazyLoader("training_lib", globals(), "tf_keras.engine.training") def use_wrapped_call( @@ -38,7 +38,7 @@ def use_wrapped_call( """Creates fn that adds losses returned by call_fn & returns the outputs. Args: - layer: A Keras layer object + layer: A TF-Keras layer object call_fn: tf.function that takes layer inputs (and possibly a training arg), and returns a tuple of (outputs, list of losses). call_spec: The `CallFunctionSpec` for the layer's call function. diff --git a/keras/saving/legacy/saving_utils.py b/tf_keras/saving/legacy/saving_utils.py similarity index 92% rename from keras/saving/legacy/saving_utils.py rename to tf_keras/saving/legacy/saving_utils.py index 3522f2214..c26a8306d 100644 --- a/keras/saving/legacy/saving_utils.py +++ b/tf_keras/saving/legacy/saving_utils.py @@ -19,24 +19,24 @@ import tensorflow.compat.v2 as tf -import keras -from keras import backend -from keras import losses -from keras import optimizers -from keras.engine import base_layer_utils -from keras.optimizers import optimizer_v1 -from keras.saving.legacy import serialization -from keras.utils import version_utils -from keras.utils.io_utils import ask_to_proceed_with_overwrite +import tf_keras as keras +from tf_keras import backend +from tf_keras import losses +from tf_keras import optimizers +from tf_keras.engine import base_layer_utils +from tf_keras.optimizers import optimizer_v1 +from tf_keras.saving.legacy import serialization +from tf_keras.utils import version_utils +from tf_keras.utils.io_utils import ask_to_proceed_with_overwrite # isort: off from tensorflow.python.platform import tf_logging as logging def extract_model_metrics(model): - """Convert metrics from a Keras model `compile` API to dictionary. + """Convert metrics from a TF-Keras model `compile` API to dictionary. - This is used for converting Keras models to Estimators and SavedModels. + This is used for converting TF-Keras models to Estimators and SavedModels. Args: model: A `tf.keras.Model` object. @@ -65,7 +65,7 @@ def model_call_inputs(model, keep_original_batch_size=False): [{'feature1': TensorSpec, 'feature2': TensorSpec}] Args: - model: Keras Model object. + model: TF-Keras Model object. keep_original_batch_size: A boolean indicating whether we want to keep using the original batch size or set it to None. Default is `False`, which means that the batch dim of the returned input signature will @@ -107,10 +107,10 @@ def raise_model_input_error(model): def trace_model_call(model, input_signature=None): - """Trace the model call to create a tf.function for exporting a Keras model. + """Trace the model call to create a tf.function for exporting a TF-Keras model. Args: - model: A Keras model. + model: A TF-Keras model. input_signature: optional, a list of tf.TensorSpec objects specifying the inputs to the model. @@ -149,7 +149,7 @@ def _wrapped_model(*args, **kwargs): # Outputs always has to be a flat dict. output_names = model.output_names # Functional Model. if output_names is None: # Subclassed Model. - from keras.engine import compile_utils + from tf_keras.engine import compile_utils output_names = compile_utils.create_pseudo_output_names(outputs) outputs = tf.nest.flatten(outputs) @@ -160,8 +160,8 @@ def _wrapped_model(*args, **kwargs): def model_metadata(model, include_optimizer=True, require_config=True): """Returns a dictionary containing the model metadata.""" - from keras import __version__ as keras_version - from keras.optimizers.legacy import optimizer_v2 + from tf_keras import __version__ as keras_version + from tf_keras.optimizers.legacy import optimizer_v2 model_config = {"class_name": model.__class__.__name__} try: @@ -185,7 +185,7 @@ def model_metadata(model, include_optimizer=True, require_config=True): "As a result, we cannot save the optimizer " "as part of the model save file. " "You will have to compile your model again after loading it. " - "Prefer using a Keras optimizer instead " + "Prefer using a TF-Keras optimizer instead " "(see keras.io/optimizers)." ) elif model._compile_was_called: @@ -271,11 +271,11 @@ def compile_args_from_training_config(training_config, custom_objects=None): def _deserialize_nested_config(deserialize_fn, config): - """Deserializes arbitrary Keras `config` using `deserialize_fn`.""" + """Deserializes arbitrary TF-Keras `config` using `deserialize_fn`.""" def _is_single_object(obj): if isinstance(obj, dict) and "class_name" in obj: - return True # Serialized Keras object. + return True # Serialized TF-Keras object. if isinstance(obj, str): return True # Serialized function or string. return False @@ -301,7 +301,7 @@ def _is_single_object(obj): def _serialize_nested_config(config): - """Serialized a nested structure of Keras objects.""" + """Serialized a nested structure of TF-Keras objects.""" def _serialize_fn(obj): if callable(obj): @@ -313,7 +313,7 @@ def _serialize_fn(obj): def _deserialize_metric(metric_config): """Deserialize metrics, leaving special strings untouched.""" - from keras import metrics as metrics_module + from tf_keras import metrics as metrics_module if metric_config in ["accuracy", "acc", "crossentropy", "ce"]: # Do not deserialize accuracy and cross-entropy strings as we have diff --git a/keras/saving/legacy/saving_utils_test.py b/tf_keras/saving/legacy/saving_utils_test.py similarity index 98% rename from keras/saving/legacy/saving_utils_test.py rename to tf_keras/saving/legacy/saving_utils_test.py index 3a34783f4..d01cfdf8b 100644 --- a/keras/saving/legacy/saving_utils_test.py +++ b/tf_keras/saving/legacy/saving_utils_test.py @@ -19,14 +19,14 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras import backend -from keras.engine import sequential -from keras.feature_column import dense_features -from keras.optimizers.legacy import gradient_descent -from keras.saving.legacy import saving_utils -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras import backend +from tf_keras.engine import sequential +from tf_keras.feature_column import dense_features +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.saving.legacy import saving_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class TraceModelCallTest(test_combinations.TestCase): diff --git a/keras/saving/legacy/serialization.py b/tf_keras/saving/legacy/serialization.py similarity index 96% rename from keras/saving/legacy/serialization.py rename to tf_keras/saving/legacy/serialization.py index 7d55d92f5..2286fd3f1 100644 --- a/keras/saving/legacy/serialization.py +++ b/tf_keras/saving/legacy/serialization.py @@ -12,15 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Legacy serialization logic for Keras models.""" +"""Legacy serialization logic for TF-Keras models.""" import threading import weakref import tensorflow.compat.v2 as tf -from keras.utils import tf_contextlib -from keras.utils import tf_inspect +from tf_keras.utils import tf_contextlib +from tf_keras.utils import tf_inspect # isort: off from tensorflow.python.util.tf_export import keras_export @@ -279,7 +279,7 @@ def skip_failed_serialization(): @keras_export("keras.utils.legacy.serialize_keras_object") def serialize_keras_object(instance): - """Serialize a Keras object into a JSON-compatible representation. + """Serialize a TF-Keras object into a JSON-compatible representation. Calls to `serialize_keras_object` while underneath the `SharedObjectSavingScope` context manager will cause any objects re-used @@ -292,7 +292,7 @@ def serialize_keras_object(instance): Returns: A dict-like, JSON-compatible representation of the object's config. """ - from keras.saving import object_registration + from tf_keras.saving import object_registration _, instance = tf.__internal__.decorator.unwrap(instance) if instance is None: @@ -345,7 +345,7 @@ def class_and_config_for_serialized_keras_object( printable_module_name="object", ): """Returns the class name and config for a serialized keras object.""" - from keras.saving import object_registration + from tf_keras.saving import object_registration if ( not isinstance(config, dict) @@ -366,7 +366,7 @@ def class_and_config_for_serialized_keras_object( f"Unknown {printable_module_name}: '{class_name}'. " "Please ensure you are using a `keras.utils.custom_object_scope` " "and that this object is included in the scope. See " - "https://www.tensorflow.org/guide/keras/save_and_serialize" + "https://www.tensorflow.org/guide/tf_keras/save_and_serialize" "#registering_the_custom_object for details." ) @@ -424,14 +424,14 @@ def deserialize_keras_object( custom_objects=None, printable_module_name="object", ): - """Turns the serialized form of a Keras object back into an actual object. + """Turns the serialized form of a TF-Keras object back into an actual object. This function is for mid-level library implementers rather than end users. Importantly, this utility requires you to provide the dict of `module_objects` to use for looking up the object config; this is not populated by default. If you need a deserialization utility that has - preexisting knowledge of built-in Keras objects, use e.g. + preexisting knowledge of built-in TF-Keras objects, use e.g. `keras.layers.deserialize(config)`, `keras.metrics.deserialize(config)`, etc. @@ -469,13 +469,13 @@ def deserialize(config, custom_objects=None): This is how e.g. `keras.layers.deserialize()` is implemented. """ - from keras.saving import object_registration + from tf_keras.saving import object_registration if identifier is None: return None if isinstance(identifier, dict): - # In this case we are dealing with a Keras config dictionary. + # In this case we are dealing with a TF-Keras config dictionary. config = identifier (cls, cls_config) = class_and_config_for_serialized_keras_object( config, module_objects, custom_objects, printable_module_name @@ -539,7 +539,7 @@ def deserialize(config, custom_objects=None): "Please ensure you are using a " "`keras.utils.custom_object_scope` " "and that this object is included in the scope. See " - "https://www.tensorflow.org/guide/keras/save_and_serialize" + "https://www.tensorflow.org/guide/tf_keras/save_and_serialize" "#registering_the_custom_object for details." ) diff --git a/keras/saving/object_registration.py b/tf_keras/saving/object_registration.py similarity index 91% rename from keras/saving/object_registration.py rename to tf_keras/saving/object_registration.py index a64b21f33..2431b7973 100644 --- a/keras/saving/object_registration.py +++ b/tf_keras/saving/object_registration.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Python utilities required by Keras.""" +"""Python utilities required by TF-Keras.""" import inspect import threading @@ -32,9 +32,9 @@ "keras.utils.CustomObjectScope", ) class CustomObjectScope: - """Exposes custom classes/functions to Keras deserialization internals. + """Exposes custom classes/functions to TF-Keras deserialization internals. - Under a scope `with custom_object_scope(objects_dict)`, Keras methods such + Under a scope `with custom_object_scope(objects_dict)`, TF-Keras methods such as `tf.keras.models.load_model` or `tf.keras.models.model_from_config` will be able to deserialize any custom object referenced by a saved config (e.g. a custom layer or metric). @@ -100,12 +100,12 @@ def get_custom_objects(): "keras.utils.register_keras_serializable", ) def register_keras_serializable(package="Custom", name=None): - """Registers an object with the Keras serialization framework. + """Registers an object with the TF-Keras serialization framework. - This decorator injects the decorated class or function into the Keras custom + This decorator injects the decorated class or function into the TF-Keras custom object dictionary, so that it can be serialized and deserialized without needing an entry in the user-provided custom object dict. It also injects a - function that Keras will call to get the object's serializable string key. + function that TF-Keras will call to get the object's serializable string key. Note that to be serialized and deserialized, classes must implement the `get_config()` method. Functions do not have this requirement. @@ -140,7 +140,7 @@ class MyDense(keras.layers.Dense): """ def decorator(arg): - """Registers a class with the Keras serialization framework.""" + """Registers a class with the TF-Keras serialization framework.""" class_name = name if name is not None else arg.__name__ registered_name = package + ">" + class_name @@ -162,9 +162,9 @@ def decorator(arg): "keras.saving.get_registered_name", "keras.utils.get_registered_name" ) def get_registered_name(obj): - """Returns the name registered to an object within the Keras framework. + """Returns the name registered to an object within the TF-Keras framework. - This function is part of the Keras serialization and deserialization + This function is part of the TF-Keras serialization and deserialization framework. It maps objects to the string names associated with those objects for serialization/deserialization. @@ -185,9 +185,9 @@ def get_registered_name(obj): "keras.saving.get_registered_object", "keras.utils.get_registered_object" ) def get_registered_object(name, custom_objects=None, module_objects=None): - """Returns the class associated with `name` if it is registered with Keras. + """Returns the class associated with `name` if it is registered with TF-Keras. - This function is part of the Keras serialization and deserialization + This function is part of the TF-Keras serialization and deserialization framework. It maps strings to the objects associated with them for serialization/deserialization. diff --git a/keras/saving/object_registration_test.py b/tf_keras/saving/object_registration_test.py similarity index 96% rename from keras/saving/object_registration_test.py rename to tf_keras/saving/object_registration_test.py index 3b1a95ca5..da3f1fd32 100644 --- a/keras/saving/object_registration_test.py +++ b/tf_keras/saving/object_registration_test.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras serializable object registration functionality.""" +"""Tests for TF-Keras serializable object registration functionality.""" import tensorflow.compat.v2 as tf -import keras -from keras.saving import object_registration -from keras.saving import serialization_lib +import tf_keras as keras +from tf_keras.saving import object_registration +from tf_keras.saving import serialization_lib class TestObjectRegistration(tf.test.TestCase): diff --git a/keras/saving/pickle_utils.py b/tf_keras/saving/pickle_utils.py similarity index 92% rename from keras/saving/pickle_utils.py rename to tf_keras/saving/pickle_utils.py index fe84b548f..4af536f0b 100644 --- a/keras/saving/pickle_utils.py +++ b/tf_keras/saving/pickle_utils.py @@ -18,7 +18,7 @@ import tensorflow.compat.v2 as tf -from keras.saving import saving_lib +from tf_keras.saving import saving_lib def deserialize_model_from_bytecode(serialized_model): @@ -29,7 +29,7 @@ def deserialize_model_from_bytecode(serialized_model): `serialize_model_as_bytecode`. Returns: - Keras Model instance. + TF-Keras Model instance. """ # Note: we don't use a RAM path for this because zipfile cannot write # to such paths. @@ -53,10 +53,10 @@ def deserialize_model_from_bytecode(serialized_model): def serialize_model_as_bytecode(model): - """Convert a Keras Model into a bytecode representation for pickling. + """Convert a TF-Keras Model into a bytecode representation for pickling. Args: - model: Keras Model instance. + model: TF-Keras Model instance. Returns: Tuple that can be read by `deserialize_from_bytecode`. diff --git a/keras/saving/pickle_utils_test.py b/tf_keras/saving/pickle_utils_test.py similarity index 95% rename from keras/saving/pickle_utils_test.py rename to tf_keras/saving/pickle_utils_test.py index 0d487ea84..2ce612494 100644 --- a/keras/saving/pickle_utils_test.py +++ b/tf_keras/saving/pickle_utils_test.py @@ -12,15 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for pickling / deepcopying of Keras Models.""" +"""Tests for pickling / deepcopying of TF-Keras Models.""" import copy import pickle import numpy as np import tensorflow.compat.v2 as tf -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils @test_utils.run_v2_only diff --git a/keras/saving/saving_api.py b/tf_keras/saving/saving_api.py similarity index 93% rename from keras/saving/saving_api.py rename to tf_keras/saving/saving_api.py index 32c01da30..3bc111210 100644 --- a/keras/saving/saving_api.py +++ b/tf_keras/saving/saving_api.py @@ -21,9 +21,9 @@ import tensorflow.compat.v2 as tf from tensorflow.python.util.tf_export import keras_export -from keras.saving import saving_lib -from keras.saving.legacy import save as legacy_sm_saving_lib -from keras.utils import io_utils +from tf_keras.saving import saving_lib +from tf_keras.saving.legacy import save as legacy_sm_saving_lib +from tf_keras.utils import io_utils try: import h5py @@ -54,13 +54,13 @@ def save_model(model, filepath, overwrite=True, save_format=None, **kwargs): https://keras.io/guides/serialization_and_saving/) for details. Args: - model: Keras model instance to be saved. + model: TF-Keras model instance to be saved. filepath: `str` or `pathlib.Path` object. Path where to save the model. overwrite: Whether we should overwrite any existing model at the target location, or instead ask the user via an interactive prompt. - save_format: Either `"keras"`, `"tf"`, `"h5"`, + save_format: Either `"tf_keras"`, `"tf"`, `"h5"`, indicating whether to save the model - in the native Keras format (`.keras`), + in the native TF-Keras format (`.keras`), in the TensorFlow SavedModel format (referred to as "SavedModel" below), or in the legacy HDF5 format (`.h5`). Defaults to `"tf"` in TF 2.X, and `"h5"` in TF 1.X. @@ -114,7 +114,7 @@ def save_model(model, filepath, overwrite=True, save_format=None, **kwargs): With `save_format="tf"`, the model and all trackable objects attached to the it (e.g. layers and variables) are saved as a TensorFlow SavedModel. The model config, weights, and optimizer are included in the SavedModel. - Additionally, for every Keras layer attached to the model, the SavedModel + Additionally, for every TF-Keras layer attached to the model, the SavedModel stores: * The config and metadata -- e.g. name, dtype, trainable status @@ -141,12 +141,12 @@ def save_model(model, filepath, overwrite=True, save_format=None, **kwargs): warnings.warn( "You are saving your model as an HDF5 file via `model.save()`. " "This file format is considered legacy. " - "We recommend using instead the native Keras format, " + "We recommend using instead the native TF-Keras format, " "e.g. `model.save('my_model.keras')`.", stacklevel=2, ) - if save_format == "keras": + if save_format == "tf_keras": # If file exists and should not be overwritten. try: exists = os.path.exists(filepath) @@ -159,7 +159,7 @@ def save_model(model, filepath, overwrite=True, save_format=None, **kwargs): if kwargs: raise ValueError( "The following argument(s) are not supported " - f"with the native Keras format: {list(kwargs.keys())}" + f"with the native TF-Keras format: {list(kwargs.keys())}" ) saving_lib.save_model(model, filepath) else: @@ -188,7 +188,7 @@ def load_model( safe_mode: Boolean, whether to disallow unsafe `lambda` deserialization. When `safe_mode=False`, loading an object has the potential to trigger arbitrary code execution. This argument is only - applicable to the Keras v3 model format. Defaults to True. + applicable to the TF-Keras v3 model format. Defaults to True. SavedModel format arguments: options: Only applies to SavedModel format. @@ -196,7 +196,7 @@ def load_model( SavedModel loading options. Returns: - A Keras model instance. If the original model was compiled, + A TF-Keras model instance. If the original model was compiled, and the argument `compile=True` is set, then the returned model will be compiled. Otherwise, the model will be left uncompiled. @@ -249,7 +249,7 @@ def load_model( if kwargs: raise ValueError( "The following argument(s) are not supported " - f"with the native Keras format: {list(kwargs.keys())}" + f"with the native TF-Keras format: {list(kwargs.keys())}" ) return saving_lib.load_model( filepath, @@ -310,10 +310,10 @@ def load_weights(model, filepath, skip_mismatch=False, **kwargs): def get_save_format(filepath, save_format): if save_format: if save_format == "keras_v3": - return "keras" - if save_format == "keras": + return "tf_keras" + if save_format == "tf_keras": if saving_lib.saving_v3_enabled(): - return "keras" + return "tf_keras" else: return "h5" if save_format in ("h5", "hdf5"): @@ -331,7 +331,7 @@ def get_save_format(filepath, save_format): if str(filepath).endswith(".keras"): if saving_lib.saving_v3_enabled(): - return "keras" + return "tf_keras" else: return "h5" diff --git a/keras/saving/saving_lib.py b/tf_keras/saving/saving_lib.py similarity index 94% rename from keras/saving/saving_lib.py rename to tf_keras/saving/saving_lib.py index a50dd1998..f02eb23ae 100644 --- a/keras/saving/saving_lib.py +++ b/tf_keras/saving/saving_lib.py @@ -27,15 +27,15 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras import losses -from keras.engine import base_layer -from keras.optimizers import optimizer -from keras.saving.serialization_lib import ObjectSharingScope -from keras.saving.serialization_lib import deserialize_keras_object -from keras.saving.serialization_lib import serialize_keras_object -from keras.utils import generic_utils -from keras.utils import io_utils +import tf_keras as keras +from tf_keras import losses +from tf_keras.engine import base_layer +from tf_keras.optimizers import optimizer +from tf_keras.saving.serialization_lib import ObjectSharingScope +from tf_keras.saving.serialization_lib import deserialize_keras_object +from tf_keras.saving.serialization_lib import serialize_keras_object +from tf_keras.utils import generic_utils +from tf_keras.utils import io_utils try: import h5py @@ -43,7 +43,7 @@ h5py = None keras_saving_gauge = tf.__internal__.monitoring.BoolGauge( - "/tensorflow/api/keras/saving", "keras saving usage", "method" + "/tensorflow/api/tf_keras/saving", "keras saving usage", "method" ) # isort: off @@ -108,7 +108,7 @@ def save_model(model, filepath, weights_format="h5"): - """Save a zip-archive representing a Keras model to the given filepath. + """Save a zip-archive representing a TF-Keras model to the given filepath. The zip-based archive contains the following structure: @@ -118,7 +118,7 @@ def save_model(model, filepath, weights_format="h5"): model/states.npz, model/dense_layer/states.npz, etc. - Metadata file. - The states of Keras trackables (layers, optimizers, loss, and metrics) are + The states of TF-Keras trackables (layers, optimizers, loss, and metrics) are automatically saved as long as they can be discovered through the attributes returned by `dir(Model)`. Typically, the state includes the variables associated with the trackable, but some specially purposed layers may @@ -132,7 +132,7 @@ def save_model(model, filepath, weights_format="h5"): layer attribute. """ - # API usage tracking for Keras V3 saving + # API usage tracking for TF-Keras V3 saving keras_saving_gauge.get_cell("save_model_v3").set(True) filepath = str(filepath) @@ -166,8 +166,8 @@ def save_model(model, filepath, weights_format="h5"): ) # TODO(rameshsampath): Need a better logic for local vs remote path if is_remote_path(filepath): - # Remote path. Zip to local drive and copy to remote - zip_filepath = os.path.join(get_temp_dir(), "tmp_model.keras") + # Remote path. Zip to local memory byte io and copy to remote + zip_filepath = io.BytesIO() else: zip_filepath = filepath try: @@ -205,10 +205,8 @@ def save_model(model, filepath, weights_format="h5"): asset_store.close() if is_remote_path(filepath): - # Using tf.io.gfile context manager doesn't close zip file when - # writing to GCS. Hence writing to local and copying to filepath. - tf.io.gfile.copy(zip_filepath, filepath, overwrite=True) - os.remove(zip_filepath) + with tf.io.gfile.GFile(filepath, "wb") as f: + f.write(zip_filepath.getvalue()) except Exception as e: raise e finally: @@ -216,7 +214,7 @@ def save_model(model, filepath, weights_format="h5"): def load_model(filepath, custom_objects=None, compile=True, safe_mode=True): - """Load a zip archive representing a Keras model.""" + """Load a zip archive representing a TF-Keras model.""" filepath = str(filepath) if not filepath.endswith(".keras"): @@ -293,7 +291,7 @@ def save_weights_only(model, filepath): # TODO: if h5 filepath is remote, create the file in a temporary directory # then upload it - # API usage tracking for Keras V3 saving + # API usage tracking for TF-Keras V3 saving keras_saving_gauge.get_cell("save_weights_v3").set(True) filepath = str(filepath) @@ -451,7 +449,7 @@ def _load_state( if visited_trackables is not None: visited_trackables.add(id(trackable)) - # Recursively load states for Keras trackables such as layers/optimizers. + # Recursively load states for TF-Keras trackables such as layers/optimizers. for child_attr, child_obj in _walk_trackable(trackable): if _is_keras_trackable(child_obj): _load_state( @@ -700,7 +698,7 @@ def get_temp_dir(): def _is_keras_trackable(obj): - from keras.metrics import base_metric # To avoid circular import + from tf_keras.metrics import base_metric # To avoid circular import return isinstance( obj, diff --git a/keras/saving/saving_lib_test.py b/tf_keras/saving/saving_lib_test.py similarity index 98% rename from keras/saving/saving_lib_test.py rename to tf_keras/saving/saving_lib_test.py index d13c3457a..74d3e9508 100644 --- a/keras/saving/saving_lib_test.py +++ b/tf_keras/saving/saving_lib_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras python-based idempotent saving functions.""" +"""Tests for TF-Keras python-based idempotent saving functions.""" import os import sys import zipfile @@ -25,14 +25,14 @@ from absl.testing import parameterized from tensorflow.python.platform import tf_logging as logging -import keras -from keras import backend -from keras.optimizers import adam -from keras.saving import object_registration -from keras.saving import saving_lib -from keras.saving.legacy.saved_model import json_utils -from keras.testing_infra import test_utils -from keras.utils import io_utils +import tf_keras as keras +from tf_keras import backend +from tf_keras.optimizers import adam +from tf_keras.saving import object_registration +from tf_keras.saving import saving_lib +from tf_keras.saving.legacy.saved_model import json_utils +from tf_keras.testing_infra import test_utils +from tf_keras.utils import io_utils train_step_message = "This is my training step" assets_data = "These are my assets" diff --git a/keras/saving/serialization_lib.py b/tf_keras/saving/serialization_lib.py similarity index 95% rename from keras/saving/serialization_lib.py rename to tf_keras/saving/serialization_lib.py index 6f72af9f6..9846c48de 100644 --- a/keras/saving/serialization_lib.py +++ b/tf_keras/saving/serialization_lib.py @@ -23,10 +23,10 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.saving import object_registration -from keras.saving.legacy import serialization as legacy_serialization -from keras.saving.legacy.saved_model.utils import in_tf_saved_model_scope -from keras.utils import generic_utils +from tf_keras.saving import object_registration +from tf_keras.saving.legacy import serialization as legacy_serialization +from tf_keras.saving.legacy.saved_model.utils import in_tf_saved_model_scope +from tf_keras.utils import generic_utils # isort: off from tensorflow.python.util import tf_export @@ -39,7 +39,7 @@ # to allow for serialization of custom_gradient. NON_SERIALIZABLE_CLASS_MODULES = ("tensorflow.python.ops.custom_gradient",) -# List of Keras modules with built-in string representations for Keras defaults +# List of TF-Keras modules with built-in string representations for TF-Keras defaults BUILTIN_MODULES = ( "activations", "constraints", @@ -129,15 +129,15 @@ def record_object_after_deserialization(obj, obj_id): "keras.saving.serialize_keras_object", "keras.utils.serialize_keras_object" ) def serialize_keras_object(obj): - """Retrieve the config dict by serializing the Keras object. + """Retrieve the config dict by serializing the TF-Keras object. - `serialize_keras_object()` serializes a Keras object to a python dictionary + `serialize_keras_object()` serializes a TF-Keras object to a python dictionary that represents the object, and is a reciprocal function of `deserialize_keras_object()`. See `deserialize_keras_object()` for more information about the config format. Args: - obj: the Keras object to serialize. + obj: the TF-Keras object to serialize. Returns: A python dict that represents the object. The python dict can be @@ -302,10 +302,10 @@ def get_build_and_compile_config(obj, config): def serialize_with_public_class(cls, inner_config=None): - """Serializes classes from public Keras API or object registration. + """Serializes classes from public TF-Keras API or object registration. Called to check and retrieve the config of any class that has a public - Keras API or has been registered as serializable via + TF-Keras API or has been registered as serializable via `keras.saving.register_keras_serializable()`. """ # This gets the `keras.*` exported name, such as "keras.optimizers.Adam". @@ -327,7 +327,7 @@ def serialize_with_public_class(cls, inner_config=None): "registered_name": registered_name, } - # Split the canonical Keras API name into a Keras module and class name. + # Split the canonical TF-Keras API name into a TF-Keras module and class name. parts = keras_api_name.split(".") return { "module": ".".join(parts[:-1]), @@ -338,10 +338,10 @@ def serialize_with_public_class(cls, inner_config=None): def serialize_with_public_fn(fn, config, fn_module_name=None): - """Serializes functions from public Keras API or object registration. + """Serializes functions from public TF-Keras API or object registration. Called to check and retrieve the config of any function that has a public - Keras API or has been registered as serializable via + TF-Keras API or has been registered as serializable via `keras.saving.register_keras_serializable()`. If function's module name is already known, returns corresponding config. """ @@ -413,9 +413,9 @@ def deserialize_keras_object( """Retrieve the object by deserializing the config dict. The config dict is a Python dictionary that consists of a set of key-value - pairs, and represents a Keras object, such as an `Optimizer`, `Layer`, + pairs, and represents a TF-Keras object, such as an `Optimizer`, `Layer`, `Metrics`, etc. The saving and loading library uses the following keys to - record information of a Keras object: + record information of a TF-Keras object: - `class_name`: String. This is the name of the class, as exactly defined in the source @@ -423,7 +423,7 @@ def deserialize_keras_object( - `config`: Dict. Library-defined or user-defined key-value pairs that store the configuration of the object, as obtained by `object.get_config()`. - `module`: String. The path of the python module, such as - "keras.engine.compile_utils". Built-in Keras classes + "keras.engine.compile_utils". Built-in TF-Keras classes expect to have prefix `keras`. - `registered_name`: String. The key the class is registered under via `keras.saving.register_keras_serializable(package, name)` API. The key has @@ -456,7 +456,7 @@ def deserialize_keras_object( deserialize_keras_object(dict_structure) ``` - If the class does not have an exported Keras namespace, the library tracks + If the class does not have an exported TF-Keras namespace, the library tracks it by its `module` and `class_name`. For example: ```python @@ -502,7 +502,7 @@ class ModifiedMeanSquaredError(keras.losses.MeanSquaredError): safe_mode: Boolean, whether to disallow unsafe `lambda` deserialization. When `safe_mode=False`, loading an object has the potential to trigger arbitrary code execution. This argument is only - applicable to the Keras v3 model format. Defaults to `True`. + applicable to the TF-Keras v3 model format. Defaults to `True`. Returns: The object described by the `config` dictionary. @@ -757,11 +757,11 @@ def _retrieve_class_or_fn( return custom_obj if module: - # If it's a Keras built-in object, + # If it's a TF-Keras built-in object, # we cannot always use direct import, because the exported # module name might not match the package structure # (e.g. experimental symbols). - if module == "keras" or module.startswith("keras."): + if module == "tf_keras" or module.startswith("keras."): api_name = module + "." + name # Legacy internal APIs are stored in TF API naming dict @@ -773,9 +773,9 @@ def _retrieve_class_or_fn( if obj is not None: return obj - # Configs of Keras built-in functions do not contain identifying + # Configs of TF-Keras built-in functions do not contain identifying # information other than their name (e.g. 'acc' or 'tanh'). This special - # case searches the Keras modules that contain built-ins to retrieve + # case searches the TF-Keras modules that contain built-ins to retrieve # the corresponding function from the identifying string. if obj_type == "function" and module == "builtins": for mod in BUILTIN_MODULES: diff --git a/keras/saving/serialization_lib_test.py b/tf_keras/saving/serialization_lib_test.py similarity index 98% rename from keras/saving/serialization_lib_test.py rename to tf_keras/saving/serialization_lib_test.py index 6645ee9b7..da236f2f0 100644 --- a/keras/saving/serialization_lib_test.py +++ b/tf_keras/saving/serialization_lib_test.py @@ -20,10 +20,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.saving import serialization_lib -from keras.saving.legacy import serialization as legacy_serialization -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy import serialization as legacy_serialization +from tf_keras.testing_infra import test_utils def custom_fn(x): @@ -313,7 +313,7 @@ def from_config(cls, config): self.assertIs(new_layers[0].activation, new_layers[1].activation) def test_legacy_internal_object(self): - from keras.layers.rnn.legacy_cells import ( + from tf_keras.layers.rnn.legacy_cells import ( LSTMCell, # pylint: disable=C6204 ) diff --git a/keras/testing_infra/BUILD b/tf_keras/testing_infra/BUILD similarity index 63% rename from keras/testing_infra/BUILD rename to tf_keras/testing_infra/BUILD index caee29ae0..3a8d76342 100644 --- a/keras/testing_infra/BUILD +++ b/tf_keras/testing_infra/BUILD @@ -1,13 +1,13 @@ # Description: -# Contains the Keras testing infrastructure. +# Contains the TF-Keras testing infrastructure. # Placeholder: load unaliased py_library # Placeholder: load unaliased py_test -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], - default_visibility = ["//keras:friends"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], + default_visibility = ["//tf_keras:friends"], licenses = ["notice"], ) @@ -19,9 +19,9 @@ py_library( srcs_version = "PY3", deps = [ ":test_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -34,17 +34,17 @@ py_library( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/engine:base_layer_utils", - "//keras/layers", - "//keras/models", - "//keras/optimizers/legacy:optimizers", - "//keras/utils:tf_contextlib", - "//keras/utils:tf_inspect", + "//tf_keras:backend", + "//tf_keras/engine:base_layer_utils", + "//tf_keras/layers", + "//tf_keras/models", + "//tf_keras/optimizers/legacy:optimizers", + "//tf_keras/utils:tf_contextlib", + "//tf_keras/utils:tf_inspect", ], ) -# TODO(mattdangerw): For now, Keras will maintain its own doc checker. +# TODO(mattdangerw): For now, TF-Keras will maintain its own doc checker. # If TensorFlow exposes one, we could consider depending on that directly. py_library( name = "keras_doctest_lib", @@ -66,7 +66,7 @@ py_test( ], deps = [ ":keras_doctest_lib", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", ], ) @@ -80,9 +80,9 @@ tf_py_test( deps = [ ":test_combinations", ":test_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) diff --git a/keras/testing_infra/__init__.py b/tf_keras/testing_infra/__init__.py similarity index 100% rename from keras/testing_infra/__init__.py rename to tf_keras/testing_infra/__init__.py diff --git a/keras/testing_infra/keras_doctest_lib.py b/tf_keras/testing_infra/keras_doctest_lib.py similarity index 99% rename from keras/testing_infra/keras_doctest_lib.py rename to tf_keras/testing_infra/keras_doctest_lib.py index 101eb2394..d89eec107 100644 --- a/keras/testing_infra/keras_doctest_lib.py +++ b/tf_keras/testing_infra/keras_doctest_lib.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Run doctests for Keras.""" +"""Run doctests for TF-Keras.""" import doctest import re diff --git a/keras/testing_infra/keras_doctest_lib_test.py b/tf_keras/testing_infra/keras_doctest_lib_test.py similarity index 99% rename from keras/testing_infra/keras_doctest_lib_test.py rename to tf_keras/testing_infra/keras_doctest_lib_test.py index c31f8f05f..b4ef34cee 100644 --- a/keras/testing_infra/keras_doctest_lib_test.py +++ b/tf_keras/testing_infra/keras_doctest_lib_test.py @@ -19,7 +19,7 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.testing_infra import keras_doctest_lib +from tf_keras.testing_infra import keras_doctest_lib class KerasDoctestOutputCheckerTest(parameterized.TestCase): diff --git a/keras/testing_infra/test_combinations.py b/tf_keras/testing_infra/test_combinations.py similarity index 94% rename from keras/testing_infra/test_combinations.py rename to tf_keras/testing_infra/test_combinations.py index 2f29e1e3d..92a55e678 100644 --- a/keras/testing_infra/test_combinations.py +++ b/tf_keras/testing_infra/test_combinations.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Utilities for unit-testing Keras.""" +"""Utilities for unit-testing TF-Keras.""" import collections @@ -23,8 +23,8 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_utils try: import h5py @@ -41,15 +41,15 @@ def tearDown(self): def run_with_all_saved_model_formats(test_or_class=None, exclude_formats=None): - """Execute the decorated test with all Keras saved model formats). + """Execute the decorated test with all TF-Keras saved model formats). This decorator is intended to be applied either to individual test methods in a `test_combinations.TestCase` class, or directly to a test class that extends it. Doing so will cause the contents of the individual test method (or all test methods in the class) to be executed multiple times - once for - each Keras saved model format. + each TF-Keras saved model format. - The Keras saved model formats include: + The TF-Keras saved model formats include: 1. HDF5: 'h5' 2. SavedModel: 'tf' @@ -58,7 +58,7 @@ def run_with_all_saved_model_formats(test_or_class=None, exclude_formats=None): Various methods in `testing_utils` to get file path for saved models will auto-generate a string of the two saved model formats. This allows unittests - to confirm the equivalence between the two Keras saved model formats. + to confirm the equivalence between the two TF-Keras saved model formats. For example, consider the following unittest: @@ -110,13 +110,13 @@ def test_foo(self): this method returns a decorator that can be applied to a test method or test class. If it is not None this returns the decorator applied to the test or class. - exclude_formats: A collection of Keras saved model formats to not run. + exclude_formats: A collection of TF-Keras saved model formats to not run. (May also be a single format not wrapped in a collection). Defaults to `None`. Returns: Returns a decorator that will run the decorated test method multiple - times: once for each desired Keras saved model format. + times: once for each desired TF-Keras saved model format. Raises: ImportError: If abseil parameterized is not installed or not included as @@ -179,22 +179,22 @@ def run_with_all_weight_formats(test_or_class=None, exclude_formats=None): # TODO(kaftan): Possibly enable 'subclass_custom_build' when tests begin to pass # it. Or perhaps make 'subclass' always use a custom build method. def run_with_all_model_types(test_or_class=None, exclude_models=None): - """Execute the decorated test with all Keras model types. + """Execute the decorated test with all TF-Keras model types. This decorator is intended to be applied either to individual test methods in a `test_combinations.TestCase` class, or directly to a test class that extends it. Doing so will cause the contents of the individual test method (or all test methods in the class) to be executed multiple times - once for - each Keras model type. + each TF-Keras model type. - The Keras model types are: ['functional', 'subclass', 'sequential'] + The TF-Keras model types are: ['functional', 'subclass', 'sequential'] Note: if stacking this decorator with absl.testing's parameterized decorators, those should be at the bottom of the stack. Various methods in `testing_utils` to get models will auto-generate a model - of the currently active Keras model type. This allows unittests to confirm - the equivalence between different Keras models. + of the currently active TF-Keras model type. This allows unittests to confirm + the equivalence between different TF-Keras models. For example, consider the following unittest: @@ -256,13 +256,13 @@ def test_foo(self): this method returns a decorator that can be applied to a test method or test class. If it is not None this returns the decorator applied to the test or class. - exclude_models: A collection of Keras model types to not run. + exclude_models: A collection of TF-Keras model types to not run. (May also be a single model type not wrapped in a collection). Defaults to `None`. Returns: Returns a decorator that will run the decorated test method multiple - times: once for each desired Keras model type. + times: once for each desired TF-Keras model type. Raises: ImportError: If abseil parameterized is not installed or not included as @@ -363,7 +363,7 @@ def test_foo(self): ``` This test will try compiling & fitting the small functional mlp using all - three Keras execution modes. + three TF-Keras execution modes. Args: test_or_class: test method or class to be annotated. If None, @@ -377,7 +377,7 @@ def test_foo(self): always_skip_eager: If True, does not execute the decorated test with eager execution modes. **kwargs: Additional kwargs for configuring tests for - in-progress Keras behaviors/ refactorings that we haven't fully + in-progress TF-Keras behaviors/ refactorings that we haven't fully rolled out yet Returns: @@ -533,7 +533,7 @@ def keras_model_type_combinations(): class KerasModeCombination(tf.__internal__.test.combinations.TestCombination): - """Combination for Keras test mode. + """Combination for TF-Keras test mode. It by default includes v1_session, v2_eager and v2_tf_function. """ @@ -555,13 +555,13 @@ def parameter_modifiers(self): class KerasModelTypeCombination( tf.__internal__.test.combinations.TestCombination ): - """Combination for Keras model types when doing model test. + """Combination for TF-Keras model types when doing model test. It by default includes 'functional', 'subclass', 'sequential'. Various methods in `testing_utils` to get models will auto-generate a model - of the currently active Keras model type. This allows unittests to confirm - the equivalence between different Keras models. + of the currently active TF-Keras model type. This allows unittests to confirm + the equivalence between different TF-Keras models. """ def context_managers(self, kwargs): diff --git a/keras/testing_infra/test_combinations_test.py b/tf_keras/testing_infra/test_combinations_test.py similarity index 99% rename from keras/testing_infra/test_combinations_test.py rename to tf_keras/testing_infra/test_combinations_test.py index 30493842b..65008a68d 100644 --- a/keras/testing_infra/test_combinations_test.py +++ b/tf_keras/testing_infra/test_combinations_test.py @@ -12,17 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras test_utils.""" +"""Tests for TF-Keras test_utils.""" import unittest import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import models as keras_models -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras import models as keras_models +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class CombinationsTest(tf.test.TestCase): diff --git a/keras/testing_infra/test_utils.py b/tf_keras/testing_infra/test_utils.py similarity index 96% rename from keras/testing_infra/test_utils.py rename to tf_keras/testing_infra/test_utils.py index 0c138c1ae..93e8068fb 100644 --- a/keras/testing_infra/test_utils.py +++ b/tf_keras/testing_infra/test_utils.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Utilities for unit-testing Keras.""" +"""Utilities for unit-testing TF-Keras.""" import collections @@ -25,19 +25,19 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras import layers -from keras import models -from keras.engine import base_layer_utils -from keras.optimizers.legacy import adadelta as adadelta_v2 -from keras.optimizers.legacy import adagrad as adagrad_v2 -from keras.optimizers.legacy import adam as adam_v2 -from keras.optimizers.legacy import adamax as adamax_v2 -from keras.optimizers.legacy import gradient_descent as gradient_descent_v2 -from keras.optimizers.legacy import nadam as nadam_v2 -from keras.optimizers.legacy import rmsprop as rmsprop_v2 -from keras.utils import tf_contextlib -from keras.utils import tf_inspect +from tf_keras import backend +from tf_keras import layers +from tf_keras import models +from tf_keras.engine import base_layer_utils +from tf_keras.optimizers.legacy import adadelta as adadelta_v2 +from tf_keras.optimizers.legacy import adagrad as adagrad_v2 +from tf_keras.optimizers.legacy import adam as adam_v2 +from tf_keras.optimizers.legacy import adamax as adamax_v2 +from tf_keras.optimizers.legacy import gradient_descent as gradient_descent_v2 +from tf_keras.optimizers.legacy import nadam as nadam_v2 +from tf_keras.optimizers.legacy import rmsprop as rmsprop_v2 +from tf_keras.utils import tf_contextlib +from tf_keras.utils import tf_inspect # isort: off from tensorflow.python.framework import ( @@ -569,7 +569,7 @@ def get_small_mlp(num_hidden, num_classes, input_dim): class _SubclassModel(models.Model): - """A Keras subclass model.""" + """A TF-Keras subclass model.""" def __init__(self, model_layers, *args, **kwargs): """Instantiate a model. @@ -604,13 +604,13 @@ def call(self, inputs, **kwargs): return x def get_config(self): - # This test model relies on the default Keras serialization of a model, + # This test model relies on the default TF-Keras serialization of a model, # rather than providing the details of `model_layers`. raise NotImplementedError class _SubclassModelCustomBuild(models.Model): - """A Keras subclass model that uses a custom build method.""" + """A TF-Keras subclass model that uses a custom build method.""" def __init__(self, layer_generating_func, *args, **kwargs): super().__init__(*args, **kwargs) @@ -652,7 +652,7 @@ def get_model_from_layers( "functional". When None, defaults to `get_model_type`. Returns: - A Keras model. + A TF-Keras model. """ if model_type is None: model_type = get_model_type() @@ -715,7 +715,7 @@ def call(self, inputs): class _MultiIOSubclassModel(models.Model): - """Multi IO Keras subclass model.""" + """Multi IO TF-Keras subclass model.""" def __init__( self, @@ -757,7 +757,7 @@ def call(self, inputs, **kwargs): class _MultiIOSubclassModelCustomBuild(models.Model): - """Multi IO Keras subclass model that uses a custom build method.""" + """Multi IO TF-Keras subclass model that uses a custom build method.""" def __init__( self, @@ -820,8 +820,8 @@ def get_multi_io_model( shared input branch or shared output branch. The resulting model will apply each branch to a different input, to produce two outputs. - The first value in branch_a must be the Keras 'Input' layer for branch a, - and the first value in branch_b must be the Keras 'Input' layer for + The first value in branch_a must be the TF-Keras 'Input' layer for branch a, + and the first value in branch_b must be the TF-Keras 'Input' layer for branch b. example usage: @@ -840,8 +840,8 @@ def get_multi_io_model( to produce a single output. The first layer in the shared_output_branch must be able to merge a tuple of two tensors. - The first value in branch_a must be the Keras 'Input' layer for branch a, - and the first value in branch_b must be the Keras 'Input' layer for + The first value in branch_a must be the TF-Keras 'Input' layer for branch a, + and the first value in branch_b must be the TF-Keras 'Input' layer for branch b. example usage: @@ -859,7 +859,7 @@ def get_multi_io_model( the shared input branch to it. It will then respectively apply each branch to that intermediate result in parallel, to produce two outputs. - The first value in the shared_input_branch must be the Keras 'Input' layer + The first value in the shared_input_branch must be the TF-Keras 'Input' layer for the whole model. Branch a and branch b should not contain any Input layers. @@ -962,11 +962,11 @@ def get_v2_optimizer(name, **kwargs): should be sufficient, and this mapping can theoretically be removed. Args: - name: string name of Keras v2 optimizer. + name: string name of TF-Keras v2 optimizer. **kwargs: any kwargs to pass to the optimizer constructor. Returns: - Initialized Keras v2 optimizer. + Initialized TF-Keras v2 optimizer. Raises: ValueError: if an unknown name was passed. diff --git a/keras/tests/BUILD b/tf_keras/tests/BUILD similarity index 64% rename from keras/tests/BUILD rename to tf_keras/tests/BUILD index 62681c407..b5856e4ca 100644 --- a/keras/tests/BUILD +++ b/tf_keras/tests/BUILD @@ -1,20 +1,20 @@ # Description: -# Contains Keras test utils and integration tests. +# Contains TF-Keras test utils and integration tests. # Placeholder: load unaliased py_library # Placeholder: load unaliased py_test # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "cuda_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "cuda_py_test") # buildifier: disable=same-origin-load -load("@org_keras//keras:keras.bzl", "tf_py_test") -load("@org_keras//keras:keras.bzl", "tpu_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tpu_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], default_visibility = [ - "//keras:friends", + "//tf_keras:friends", "//third_party/tensorflow/tools/pip_package:__pkg__", ], licenses = ["notice"], @@ -30,11 +30,11 @@ tf_py_test( ], deps = [ ":get_config_samples", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -44,12 +44,12 @@ tf_py_test( python_version = "PY3", shard_count = 4, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -65,9 +65,9 @@ tpu_py_test( deps = [ "//:expect_tensorboard_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/distribute:distribute_strategy_test_lib", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/distribute:distribute_strategy_test_lib", ], ) @@ -78,9 +78,9 @@ tf_py_test( shard_count = 4, deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/testing_infra:test_utils", ], ) @@ -91,12 +91,12 @@ tf_py_test( shard_count = 4, tags = ["notsan"], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -106,8 +106,8 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", + "//tf_keras", + "//tf_keras/api:keras_api", ], ) @@ -121,14 +121,14 @@ tf_py_test( "notsan", ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/layers/rnn:legacy_cells", - "//keras/legacy_tf_layers:layers_base", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/layers/rnn:legacy_cells", + "//tf_keras/legacy_tf_layers:layers_base", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -139,7 +139,7 @@ py_library( ], srcs_version = "PY3", deps = [ - "//keras", + "//tf_keras", ], ) @@ -150,11 +150,11 @@ tf_py_test( shard_count = 16, deps = [ ":model_architectures", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", - "//keras", - "//keras/api:keras_api", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -163,8 +163,8 @@ py_library( srcs = ["model_subclassing_test_util.py"], srcs_version = "PY3", deps = [ - "//keras", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_utils", ], ) @@ -179,12 +179,12 @@ tf_py_test( ], deps = [ ":model_subclassing_test_util", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -199,12 +199,12 @@ tf_py_test( ], deps = [ ":model_subclassing_test_util", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -220,8 +220,8 @@ cuda_py_test( xla_enable_strict_auto_jit = False, deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", + "//tf_keras", + "//tf_keras/api:keras_api", "//third_party/tensorflow/python/eager/memory_tests:memory_test_util", ], ) @@ -242,7 +242,7 @@ tf_py_test( ], deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", + "//tf_keras/api:keras_api", ], ) @@ -256,11 +256,11 @@ tf_py_test( ], deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/layers/core", - "//keras/metrics", - "//keras/optimizers/legacy:optimizers", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/layers/core", + "//tf_keras/metrics", + "//tf_keras/optimizers/legacy:optimizers", ], ) @@ -271,9 +271,9 @@ cuda_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras/api:keras_api", - "//keras/engine", - "//keras/layers/core", + "//tf_keras/api:keras_api", + "//tf_keras/engine", + "//tf_keras/layers/core", ], ) @@ -284,11 +284,11 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/engine", - "//keras/layers/core", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/engine", + "//tf_keras/layers/core", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -300,9 +300,9 @@ tf_py_test( deps = [ "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -315,14 +315,14 @@ tf_py_test( "nomac", ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/engine", - "//keras/layers/core", - "//keras/layers/normalization", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/engine", + "//tf_keras/layers/core", + "//tf_keras/layers/normalization", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -332,14 +332,14 @@ tf_py_test( python_version = "PY3", tags = ["notsan"], # b/74395663 deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/engine", - "//keras/layers/core", - "//keras/optimizers/legacy:optimizers", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/engine", + "//tf_keras/layers/core", + "//tf_keras/optimizers/legacy:optimizers", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -352,11 +352,11 @@ tf_py_test( ], deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/api:keras_api", - "//keras/engine", - "//keras/layers/core", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/api:keras_api", + "//tf_keras/engine", + "//tf_keras/layers/core", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -379,6 +379,6 @@ py_test( ], deps = [ "//:expect_tensorflow_installed", - "//keras/testing_infra:keras_doctest_lib", + "//tf_keras/testing_infra:keras_doctest_lib", ], ) diff --git a/keras/tests/__init__.py b/tf_keras/tests/__init__.py similarity index 100% rename from keras/tests/__init__.py rename to tf_keras/tests/__init__.py diff --git a/keras/tests/add_loss_correctness_test.py b/tf_keras/tests/add_loss_correctness_test.py similarity index 98% rename from keras/tests/add_loss_correctness_test.py rename to tf_keras/tests/add_loss_correctness_test.py index 5bf87c9ce..17f028219 100644 --- a/keras/tests/add_loss_correctness_test.py +++ b/tf_keras/tests/add_loss_correctness_test.py @@ -17,14 +17,14 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import Input -from keras import Model -from keras import Sequential -from keras import layers -from keras import losses -from keras.optimizers import legacy as optimizer_legacy -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras import Input +from tf_keras import Model +from tf_keras import Sequential +from tf_keras import layers +from tf_keras import losses +from tf_keras.optimizers import legacy as optimizer_legacy +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.platform import tf_logging as logging diff --git a/keras/tests/automatic_outside_compilation_test.py b/tf_keras/tests/automatic_outside_compilation_test.py similarity index 95% rename from keras/tests/automatic_outside_compilation_test.py rename to tf_keras/tests/automatic_outside_compilation_test.py index 254679be8..8e1dd9a95 100644 --- a/keras/tests/automatic_outside_compilation_test.py +++ b/tf_keras/tests/automatic_outside_compilation_test.py @@ -21,17 +21,17 @@ import tensorflow.compat.v2 as tf from absl import flags -from keras import callbacks -from keras.distribute import distribute_strategy_test -from keras.engine import base_layer -from keras.engine import sequential as sequential_model_lib -from keras.engine import training -from keras.layers import convolutional as conv_layer_lib -from keras.layers import core as layer_lib -from keras.layers import pooling as pool_layer_lib -from keras.layers import regularization as regularization_layer_lib -from keras.layers import reshaping as reshaping_layer_lib -from keras.testing_infra import test_utils +from tf_keras import callbacks +from tf_keras.distribute import distribute_strategy_test +from tf_keras.engine import base_layer +from tf_keras.engine import sequential as sequential_model_lib +from tf_keras.engine import training +from tf_keras.layers import convolutional as conv_layer_lib +from tf_keras.layers import core as layer_lib +from tf_keras.layers import pooling as pool_layer_lib +from tf_keras.layers import regularization as regularization_layer_lib +from tf_keras.layers import reshaping as reshaping_layer_lib +from tf_keras.testing_infra import test_utils # isort: off from tensorboard.plugins.histogram import ( diff --git a/keras/tests/convert_to_constants_test.py b/tf_keras/tests/convert_to_constants_test.py similarity index 96% rename from keras/tests/convert_to_constants_test.py rename to tf_keras/tests/convert_to_constants_test.py index bb743c841..6351f1709 100644 --- a/keras/tests/convert_to_constants_test.py +++ b/tf_keras/tests/convert_to_constants_test.py @@ -19,8 +19,8 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.framework import convert_to_constants @@ -96,10 +96,10 @@ def _testConvertedFunction( @test_utils.run_v2_only def testKerasModel(self): - """Test a basic Keras model with Variables.""" + """Test a basic TF-Keras model with Variables.""" input_data = {"x": tf.constant(1.0, shape=[1, 1])} - # Create a simple Keras model. + # Create a simple TF-Keras model. x = [-1, 0, 1, 2, 3, 4] y = [-3, -1, 1, 3, 5, 7] @@ -120,7 +120,7 @@ def to_save(x): @test_utils.run_v2_only def testKerasLSTM(self): - """Test a Keras LSTM containing dynamic_rnn ops.""" + """Test a TF-Keras LSTM containing dynamic_rnn ops.""" input_data = { "x": tf.constant( np.array( diff --git a/keras/tests/custom_training_loop_test.py b/tf_keras/tests/custom_training_loop_test.py similarity index 98% rename from keras/tests/custom_training_loop_test.py rename to tf_keras/tests/custom_training_loop_test.py index c9be92dbf..e7c4e85ab 100644 --- a/keras/tests/custom_training_loop_test.py +++ b/tf_keras/tests/custom_training_loop_test.py @@ -18,9 +18,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class LayerWithLosses(keras.layers.Layer): diff --git a/keras/tests/get_config_samples.py b/tf_keras/tests/get_config_samples.py similarity index 100% rename from keras/tests/get_config_samples.py rename to tf_keras/tests/get_config_samples.py diff --git a/keras/tests/get_config_test.py b/tf_keras/tests/get_config_test.py similarity index 91% rename from keras/tests/get_config_test.py rename to tf_keras/tests/get_config_test.py index 73c24a920..75d1f0c98 100644 --- a/keras/tests/get_config_test.py +++ b/tf_keras/tests/get_config_test.py @@ -16,10 +16,10 @@ import tensorflow.compat.v2 as tf -from keras.engine import sequential -from keras.engine import training -from keras.testing_infra import test_combinations -from keras.tests import get_config_samples +from tf_keras.engine import sequential +from tf_keras.engine import training +from tf_keras.testing_infra import test_combinations +from tf_keras.tests import get_config_samples @test_combinations.run_all_keras_modes diff --git a/keras/tests/graph_util_test.py b/tf_keras/tests/graph_util_test.py similarity index 97% rename from keras/tests/graph_util_test.py rename to tf_keras/tests/graph_util_test.py index 40884cf9d..5d998704c 100644 --- a/keras/tests/graph_util_test.py +++ b/tf_keras/tests/graph_util_test.py @@ -17,7 +17,7 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras +import tf_keras as keras # isort: off from tensorflow.core.protobuf import meta_graph_pb2 @@ -61,7 +61,7 @@ def _ensure_no_variables_in_graph(self, graph_def): def _test_converted_keras_model( self, model, constant_graph_def, input_data ): - """Compares the converted Keras model.""" + """Compares the converted TF-Keras model.""" expected_value = model.predict(input_data) actual_value = self._evaluate_graph_def( constant_graph_def, model.inputs, model.outputs, [input_data] @@ -113,7 +113,7 @@ def testWithEmbeddings(self): self._test_converted_keras_model(model, constant_graph_def, input_data) def testKerasBatchNorm(self): - """Freezes a graph with Keras batch norm.""" + """Freezes a graph with TF-Keras batch norm.""" inputs = keras.layers.Input(shape=(128, 128, 1)) batch_norm = keras.layers.BatchNormalization()(inputs) model = keras.models.Model(inputs, batch_norm, name="test") @@ -145,7 +145,7 @@ def testKerasBatchNorm(self): self._test_converted_keras_model(model, constant_graph_def, input_data) def testLSTM(self): - """Freezes a Keras LSTM.""" + """Freezes a TF-Keras LSTM.""" model = keras.models.Sequential( [keras.layers.LSTM(units=10, input_shape=(10, 10))] ) diff --git a/keras/tests/integration_test.py b/tf_keras/tests/integration_test.py similarity index 98% rename from keras/tests/integration_test.py rename to tf_keras/tests/integration_test.py index 1ccfa02ae..36d923f41 100644 --- a/keras/tests/integration_test.py +++ b/tf_keras/tests/integration_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Integration tests for Keras.""" +"""Integration tests for TF-Keras.""" import os import random @@ -20,12 +20,12 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras import utils -from keras.layers.rnn import legacy_cells -from keras.legacy_tf_layers import base as base_layer -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras import utils +from tf_keras.layers.rnn import legacy_cells +from tf_keras.legacy_tf_layers import base as base_layer +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class KerasIntegrationTest(test_combinations.TestCase): diff --git a/keras/tests/keras_doctest.py b/tf_keras/tests/keras_doctest.py similarity index 98% rename from keras/tests/keras_doctest.py rename to tf_keras/tests/keras_doctest.py index 90f2c66b6..c24bce1e5 100644 --- a/keras/tests/keras_doctest.py +++ b/tf_keras/tests/keras_doctest.py @@ -26,7 +26,7 @@ from absl import flags from absl.testing import absltest -from keras.testing_infra import keras_doctest_lib +from tf_keras.testing_infra import keras_doctest_lib tf.compat.v1.enable_v2_behavior() diff --git a/keras/tests/memory_checker_test.py b/tf_keras/tests/memory_checker_test.py similarity index 99% rename from keras/tests/memory_checker_test.py rename to tf_keras/tests/memory_checker_test.py index 23373a20a..d8ee59d64 100644 --- a/keras/tests/memory_checker_test.py +++ b/tf_keras/tests/memory_checker_test.py @@ -15,7 +15,7 @@ import tensorflow.compat.v2 as tf -import keras +import tf_keras as keras # isort: off from tensorflow.python.framework.memory_checker import ( diff --git a/keras/tests/memory_test.py b/tf_keras/tests/memory_test.py similarity index 98% rename from keras/tests/memory_test.py rename to tf_keras/tests/memory_test.py index 4f3cb4f9c..a574fbf41 100644 --- a/keras/tests/memory_test.py +++ b/tf_keras/tests/memory_test.py @@ -22,7 +22,7 @@ import tensorflow.compat.v2 as tf -import keras +import tf_keras as keras # isort: off from tensorflow.python.eager.memory_tests import ( diff --git a/keras/tests/model_architectures.py b/tf_keras/tests/model_architectures.py similarity index 99% rename from keras/tests/model_architectures.py rename to tf_keras/tests/model_architectures.py index b3bd88641..574ee1739 100644 --- a/keras/tests/model_architectures.py +++ b/tf_keras/tests/model_architectures.py @@ -16,7 +16,7 @@ import collections -import keras +import tf_keras as keras # Declaring namedtuple() ModelFn = collections.namedtuple( diff --git a/keras/tests/model_architectures_test.py b/tf_keras/tests/model_architectures_test.py similarity index 94% rename from keras/tests/model_architectures_test.py rename to tf_keras/tests/model_architectures_test.py index 73193c3b1..fd68ef904 100644 --- a/keras/tests/model_architectures_test.py +++ b/tf_keras/tests/model_architectures_test.py @@ -22,11 +22,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.optimizers import optimizer_v1 -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.tests import model_architectures +import tf_keras as keras +from tf_keras.optimizers import optimizer_v1 +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.tests import model_architectures @test_combinations.run_with_all_saved_model_formats diff --git a/keras/tests/model_subclassing_compiled_test.py b/tf_keras/tests/model_subclassing_compiled_test.py similarity index 98% rename from keras/tests/model_subclassing_compiled_test.py rename to tf_keras/tests/model_subclassing_compiled_test.py index 1a93734f4..b59b9de9e 100644 --- a/keras/tests/model_subclassing_compiled_test.py +++ b/tf_keras/tests/model_subclassing_compiled_test.py @@ -19,10 +19,10 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.tests import model_subclassing_test_util as model_util +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.tests import model_subclassing_test_util as model_util try: import h5py diff --git a/keras/tests/model_subclassing_test.py b/tf_keras/tests/model_subclassing_test.py similarity index 99% rename from keras/tests/model_subclassing_test.py rename to tf_keras/tests/model_subclassing_test.py index dc56912e1..be9f36a79 100644 --- a/keras/tests/model_subclassing_test.py +++ b/tf_keras/tests/model_subclassing_test.py @@ -21,10 +21,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.tests import model_subclassing_test_util as model_util +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.tests import model_subclassing_test_util as model_util # isort: off from tensorflow.python.framework import ( diff --git a/keras/tests/model_subclassing_test_util.py b/tf_keras/tests/model_subclassing_test_util.py similarity index 98% rename from keras/tests/model_subclassing_test_util.py rename to tf_keras/tests/model_subclassing_test_util.py index 5d06f6c45..ce39d6d9a 100644 --- a/keras/tests/model_subclassing_test_util.py +++ b/tf_keras/tests/model_subclassing_test_util.py @@ -14,8 +14,8 @@ # ============================================================================== """Keras models for use in Model subclassing tests.""" -import keras -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.testing_infra import test_utils class SimpleConvTestModel(keras.Model): diff --git a/keras/tests/saved_model_test.py b/tf_keras/tests/saved_model_test.py similarity index 96% rename from keras/tests/saved_model_test.py rename to tf_keras/tests/saved_model_test.py index dd80c7d00..d5a5419ae 100644 --- a/keras/tests/saved_model_test.py +++ b/tf_keras/tests/saved_model_test.py @@ -18,8 +18,8 @@ import tensorflow.compat.v2 as tf -from keras.layers import core -from keras.optimizers.legacy import adam +from tf_keras.layers import core +from tf_keras.optimizers.legacy import adam # isort: off from tensorflow.python.framework import ( diff --git a/keras/tests/saver_test.py b/tf_keras/tests/saver_test.py similarity index 98% rename from keras/tests/saver_test.py rename to tf_keras/tests/saver_test.py index bed83b35b..1c7e67eff 100644 --- a/keras/tests/saver_test.py +++ b/tf_keras/tests/saver_test.py @@ -19,8 +19,8 @@ import tensorflow.compat.v2 as tf -from keras.engine import training -from keras.layers import core +from tf_keras.engine import training +from tf_keras.layers import core # isort: off from tensorflow.python.checkpoint import ( diff --git a/keras/tests/serialization_util_test.py b/tf_keras/tests/serialization_util_test.py similarity index 89% rename from keras/tests/serialization_util_test.py rename to tf_keras/tests/serialization_util_test.py index 71652e63e..d594090ff 100644 --- a/keras/tests/serialization_util_test.py +++ b/tf_keras/tests/serialization_util_test.py @@ -18,12 +18,12 @@ import tensorflow.compat.v2 as tf -from keras.engine import input_layer -from keras.engine import sequential -from keras.engine import training -from keras.layers import core -from keras.saving.legacy.saved_model import json_utils -from keras.testing_infra import test_combinations +from tf_keras.engine import input_layer +from tf_keras.engine import sequential +from tf_keras.engine import training +from tf_keras.layers import core +from tf_keras.saving.legacy.saved_model import json_utils +from tf_keras.testing_infra import test_combinations @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/tests/temporal_sample_weights_correctness_test.py b/tf_keras/tests/temporal_sample_weights_correctness_test.py similarity index 98% rename from keras/tests/temporal_sample_weights_correctness_test.py rename to tf_keras/tests/temporal_sample_weights_correctness_test.py index f6efd8117..c6e84e744 100644 --- a/keras/tests/temporal_sample_weights_correctness_test.py +++ b/tf_keras/tests/temporal_sample_weights_correctness_test.py @@ -12,16 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests temporal sample weights correctness using Keras model.""" +"""Tests temporal sample weights correctness using TF-Keras model.""" import numpy as np import tensorflow.compat.v2 as tf -from keras import layers -from keras import metrics -from keras.optimizers import legacy as optimizer_legacy -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras import layers +from tf_keras import metrics +from tf_keras.optimizers import legacy as optimizer_legacy +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils class Bias(layers.Layer): diff --git a/keras/tests/tracking_test.py b/tf_keras/tests/tracking_test.py similarity index 99% rename from keras/tests/tracking_test.py rename to tf_keras/tests/tracking_test.py index c8c639dcd..c996719f0 100644 --- a/keras/tests/tracking_test.py +++ b/tf_keras/tests/tracking_test.py @@ -19,11 +19,11 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.engine import sequential -from keras.engine import training -from keras.layers import core -from keras.layers.normalization import batch_normalization_v1 -from keras.testing_infra import test_combinations +from tf_keras.engine import sequential +from tf_keras.engine import training +from tf_keras.layers import core +from tf_keras.layers.normalization import batch_normalization_v1 +from tf_keras.testing_infra import test_combinations # isort: off from tensorflow.python.trackable import data_structures diff --git a/keras/tests/tracking_util_test.py b/tf_keras/tests/tracking_util_test.py similarity index 99% rename from keras/tests/tracking_util_test.py rename to tf_keras/tests/tracking_util_test.py index 4ee3cbdf9..cf5217a84 100644 --- a/keras/tests/tracking_util_test.py +++ b/tf_keras/tests/tracking_util_test.py @@ -19,14 +19,14 @@ import tensorflow.compat.v2 as tf -from keras.engine import input_layer -from keras.engine import sequential -from keras.engine import training -from keras.layers import core -from keras.layers import reshaping -from keras.optimizers.legacy import adam -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras.engine import input_layer +from tf_keras.engine import sequential +from tf_keras.engine import training +from tf_keras.layers import core +from tf_keras.layers import reshaping +from tf_keras.optimizers.legacy import adam +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.checkpoint import ( diff --git a/keras/tests/tracking_util_with_v1_optimizers_test.py b/tf_keras/tests/tracking_util_with_v1_optimizers_test.py similarity index 99% rename from keras/tests/tracking_util_with_v1_optimizers_test.py rename to tf_keras/tests/tracking_util_with_v1_optimizers_test.py index bf1d85ed7..4860ec9ba 100644 --- a/keras/tests/tracking_util_with_v1_optimizers_test.py +++ b/tf_keras/tests/tracking_util_with_v1_optimizers_test.py @@ -19,10 +19,10 @@ import tensorflow.compat.v2 as tf -from keras.engine import training -from keras.layers import core -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +from tf_keras.engine import training +from tf_keras.layers import core +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # isort: off from tensorflow.python.checkpoint import ( diff --git a/keras/tests/tracking_util_xla_test.py b/tf_keras/tests/tracking_util_xla_test.py similarity index 96% rename from keras/tests/tracking_util_xla_test.py rename to tf_keras/tests/tracking_util_xla_test.py index 4867ab5f2..2bda27d59 100644 --- a/keras/tests/tracking_util_xla_test.py +++ b/tf_keras/tests/tracking_util_xla_test.py @@ -15,9 +15,9 @@ import tensorflow.compat.v2 as tf -from keras.engine import training -from keras.layers import core -from keras.optimizers.legacy import adam +from tf_keras.engine import training +from tf_keras.layers import core +from tf_keras.optimizers.legacy import adam # isort: off from tensorflow.compiler.tests import xla_test diff --git a/keras/keras.bzl b/tf_keras/tf_keras.bzl similarity index 99% rename from keras/keras.bzl rename to tf_keras/tf_keras.bzl index 4a787d7b9..3728a6ce9 100644 --- a/keras/keras.bzl +++ b/tf_keras/tf_keras.bzl @@ -7,7 +7,7 @@ def py_test(deps = [], data = [], kernels = [], **kwargs): native.py_test( deps = select({ "//conditions:default": deps, - "//keras:no_keras_py_deps": [], + "//tf_keras:no_keras_py_deps": [], }), data = data + kernels, **kwargs diff --git a/keras/tools/bazel_build.sh b/tf_keras/tools/bazel_build.sh similarity index 100% rename from keras/tools/bazel_build.sh rename to tf_keras/tools/bazel_build.sh diff --git a/keras/tools/gpu_build/BUILD b/tf_keras/tools/gpu_build/BUILD similarity index 100% rename from keras/tools/gpu_build/BUILD rename to tf_keras/tools/gpu_build/BUILD diff --git a/keras/tools/gpu_build/parallel_gpu_execute.sh b/tf_keras/tools/gpu_build/parallel_gpu_execute.sh similarity index 100% rename from keras/tools/gpu_build/parallel_gpu_execute.sh rename to tf_keras/tools/gpu_build/parallel_gpu_execute.sh diff --git a/tf_keras/tools/pip_package/BUILD b/tf_keras/tools/pip_package/BUILD new file mode 100644 index 000000000..e12999945 --- /dev/null +++ b/tf_keras/tools/pip_package/BUILD @@ -0,0 +1,44 @@ +package(default_visibility = ["//tf_keras:__subpackages__"]) + +# Description: +# Tools for building the TensorFlow pip package. + +COMMON_PIP_DEPS = [ + "//tf_keras/api:keras_api", + # The following targets are not included by //tf_keras:keras, + # eg to avoid circular dependency with TF, but they should still be included + # in the PIP package. + "//tf_keras/legacy_tf_layers:convolutional", + "//tf_keras/legacy_tf_layers:core", + "//tf_keras/legacy_tf_layers:layers_base", + "//tf_keras/legacy_tf_layers:normalization", + "//tf_keras/legacy_tf_layers:pooling", + "//tf_keras/layers/rnn:legacy_cell_wrappers", + "//tf_keras/layers/rnn:legacy_cells", + "//tf_keras/optimizers:legacy_learning_rate_decay", + # Need to include testing libraries in pip package so our pip + # release tests can run. (see py_test rule in keras.bzl for more context). + # Essentially, everything needed to run the test (except the test file itself) + # must be contained in the pip package since we strip away all deps. + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", + "//tf_keras/benchmarks:keras_benchmark_lib_pip", + "//tf_keras/dtensor:integration_test_utils", + "//tf_keras/dtensor:test_util", + "//tf_keras/distribute:distribute_test_lib_pip", + "//tf_keras/integration_test:preprocessing_test_utils", + "//tf_keras/integration_test/models:models", + "//tf_keras/layers/preprocessing:preprocessing_test_utils", + "//tf_keras/layers/preprocessing/benchmarks:feature_column_benchmark", + "//tf_keras/mixed_precision:test_util", + "//tf_keras/tests:model_architectures", + "//tf_keras/tests:model_subclassing_test_util", + "//tf_keras/utils:dataset_creator", + "//tf_keras/utils:kpl_test_utils", +] + +sh_binary( + name = "build_pip_package", + srcs = ["build_pip_package.sh"], + data = COMMON_PIP_DEPS, +) diff --git a/keras/tools/pip_package/build_pip_package.sh b/tf_keras/tools/pip_package/build_pip_package.sh similarity index 100% rename from keras/tools/pip_package/build_pip_package.sh rename to tf_keras/tools/pip_package/build_pip_package.sh diff --git a/keras/tools/pip_package/create_pip_helper.py b/tf_keras/tools/pip_package/create_pip_helper.py similarity index 85% rename from keras/tools/pip_package/create_pip_helper.py rename to tf_keras/tools/pip_package/create_pip_helper.py index 02f380e78..65401cfa9 100644 --- a/keras/tools/pip_package/create_pip_helper.py +++ b/tf_keras/tools/pip_package/create_pip_helper.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Utils to help build and verify pip package for Keras.""" +"""Utils to help build and verify pip package for TF-Keras.""" from __future__ import absolute_import from __future__ import division @@ -24,27 +24,28 @@ PIP_EXCLUDED_FILES = frozenset( [ - "keras/api/create_python_api_wrapper.py", - "keras/applications/efficientnet_weight_update_util.py", - "keras/distribute/tpu_strategy_test_utils.py", - "keras/saving/legacy/saved_model/create_test_saved_model.py", - "keras/tools/pip_package/setup.py", - "keras/tools/pip_package/create_pip_helper.py", + "tf_keras/api/extractor_wrapper.py", + "tf_keras/api/generator_wrapper.py", + "tf_keras/applications/efficientnet_weight_update_util.py", + "tf_keras/distribute/tpu_strategy_test_utils.py", + "tf_keras/saving/legacy/saved_model/create_test_saved_model.py", + "tf_keras/tools/pip_package/setup.py", + "tf_keras/tools/pip_package/create_pip_helper.py", ] ) PIP_EXCLUDED_DIRS = frozenset( [ - "keras/benchmarks", - "keras/tests", + "tf_keras/benchmarks", + "tf_keras/tests", ] ) # Directories that should not have __init__.py files generated within them. EXCLUDED_INIT_FILE_DIRECTORIES = frozenset( [ - "keras/benchmarks", - "keras/tools", + "tf_keras/benchmarks", + "tf_keras/tools", ] ) @@ -82,7 +83,7 @@ def verify_python_files_in_pip(pip_root, bazel_root): Args: pip_root: Root directory of code being packaged into pip. - bazel_root: Root directory of Keras Bazel workspace. + bazel_root: Root directory of TF-Keras Bazel workspace. Raises: PipPackagingError: Missing file in pip. @@ -125,7 +126,7 @@ def main(): "--bazel-root", type=str, required=True, - help="Root directory of Keras Bazel workspace.", + help="Root directory of TF-Keras Bazel workspace.", ) parser.add_argument( "--pip-root", diff --git a/keras/tools/pip_package/setup.py b/tf_keras/tools/pip_package/setup.py similarity index 93% rename from keras/tools/pip_package/setup.py rename to tf_keras/tools/pip_package/setup.py index b47a0b91a..4c2105a63 100644 --- a/keras/tools/pip_package/setup.py +++ b/tf_keras/tools/pip_package/setup.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""TensorFlow Keras. +"""TensorFlow TF-Keras. -TensorFlow Keras is an implementation of the Keras API that uses TensorFlow as +TensorFlow TF-Keras is an implementation of the TF-Keras API that uses TensorFlow as a backend. """ @@ -38,7 +38,7 @@ # Add a new dep there if one is needed. ] -project_name = "keras" +project_name = "tf_keras" if "--project_name" in sys.argv: project_name_idx = sys.argv.index("--project_name") project_name = sys.argv[project_name_idx + 1] @@ -52,7 +52,7 @@ description="Deep learning for humans.", long_description="\n".join(DOCLINES[2:]), url="https://keras.io/", - download_url="https://github.com/keras-team/keras/tags", + download_url="https://github.com/keras-team/tf-keras/tags", author="Keras team", author_email="keras-users@googlegroups.com", packages=setuptools.find_packages(), diff --git a/keras/utils/BUILD b/tf_keras/utils/BUILD similarity index 78% rename from keras/utils/BUILD rename to tf_keras/utils/BUILD index 034f587f1..c8c2db58b 100644 --- a/keras/utils/BUILD +++ b/tf_keras/utils/BUILD @@ -1,13 +1,13 @@ # Description: -# Contains the Keras Utilities (internal TensorFlow version). +# Contains the TF-Keras Utilities (internal TensorFlow version). # Placeholder: load unaliased py_library -load("@org_keras//keras:keras.bzl", "tf_py_test") +load("@org_keras//tf_keras:tf_keras.bzl", "tf_py_test") package( - # copybara:uncomment default_applicable_licenses = ["//keras:license"], + # copybara:uncomment default_applicable_licenses = ["//tf_keras:license"], # TODO(scottzhu): Remove non-keras deps from TF. - default_visibility = ["//keras:friends"], + default_visibility = ["//tf_keras:friends"], licenses = ["notice"], ) @@ -47,8 +47,8 @@ py_library( srcs = ["kpl_test_utils.py"], srcs_version = "PY3", deps = [ - "//keras", - "//keras/layers/preprocessing:string_lookup", + "//tf_keras", + "//tf_keras/layers/preprocessing:string_lookup", ], ) @@ -74,7 +74,7 @@ py_library( ":data_utils", ":io_utils", ":tf_utils", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -150,7 +150,7 @@ py_library( ":engine_utils", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras:backend", + "//tf_keras:backend", ], ) @@ -260,7 +260,7 @@ py_library( ":image_utils", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/layers/preprocessing:image_preprocessing", + "//tf_keras/layers/preprocessing:image_preprocessing", ], ) @@ -317,8 +317,8 @@ py_library( srcs_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras:backend", - "//keras/layers", + "//tf_keras:backend", + "//tf_keras/layers", ], ) @@ -344,7 +344,7 @@ tf_py_test( deps = [ ":steps_per_execution_tuning", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -355,11 +355,11 @@ tf_py_test( python_version = "PY3", deps = [ ":sidecar_evaluator", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -371,10 +371,10 @@ tf_py_test( ":dataset_creator", "//:expect_portpicker_installed", "//:expect_tensorflow_installed", - "//keras/distribute:multi_worker_testing_utils", - "//keras/engine", - "//keras/layers/core", - "//keras/testing_infra:test_combinations", + "//tf_keras/distribute:multi_worker_testing_utils", + "//tf_keras/engine", + "//tf_keras/layers/core", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -385,10 +385,10 @@ tf_py_test( srcs = ["dataset_utils_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -404,10 +404,10 @@ tf_py_test( "optonly", # times out ], deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -418,9 +418,9 @@ tf_py_test( python_version = "PY3", deps = [ ":generic_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -431,10 +431,10 @@ tf_py_test( python_version = "PY3", deps = [ ":version_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -446,8 +446,8 @@ tf_py_test( deps = [ ":tf_utils", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -458,13 +458,13 @@ tf_py_test( python_version = "PY3", shard_count = 8, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras:engine", - "//keras/layers", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras:engine", + "//tf_keras/layers", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -480,11 +480,11 @@ tf_py_test( deps = [ ":io_utils", ":keras_logging", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -498,11 +498,11 @@ tf_py_test( ":tf_utils", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras:backend", - "//keras/dtensor", - "//keras/dtensor:layout_map", - "//keras/dtensor:test_util", + "//tf_keras", + "//tf_keras:backend", + "//tf_keras/dtensor", + "//tf_keras/dtensor:layout_map", + "//tf_keras/dtensor:test_util", ], ) @@ -512,11 +512,11 @@ tf_py_test( srcs = ["np_utils_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -527,7 +527,7 @@ tf_py_test( python_version = "PY3", deps = [ ":layer_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", ], ) @@ -539,10 +539,10 @@ tf_py_test( python_version = "PY3", shard_count = 4, deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -557,11 +557,11 @@ tf_py_test( ], deps = [ ":image_utils", - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -571,10 +571,10 @@ tf_py_test( srcs = ["conv_utils_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -584,10 +584,10 @@ tf_py_test( srcs = ["metrics_utils_test.py"], python_version = "PY3", deps = [ - "//:expect_absl_installed", + "//:expect_absl_installed", # absl/testing:parameterized "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -598,8 +598,8 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -610,7 +610,7 @@ tf_py_test( python_version = "PY3", deps = [ "//:expect_tensorflow_installed", - "//keras", + "//tf_keras", ], ) @@ -623,8 +623,8 @@ tf_py_test( ":image_dataset", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -636,8 +636,8 @@ tf_py_test( deps = [ ":text_dataset", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", ], ) @@ -650,8 +650,8 @@ tf_py_test( ":timeseries_dataset", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -664,8 +664,8 @@ tf_py_test( ":audio_dataset", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -679,8 +679,8 @@ tf_py_test( "//:expect_numpy_installed", "//:expect_tensorflow_installed", "//:expect_tensorflow_io_installed", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) @@ -693,20 +693,21 @@ tf_py_test( ":feature_space", "//:expect_numpy_installed", "//:expect_tensorflow_installed", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) tf_py_test( name = "timed_threads_test", size = "small", + timeout = "moderate", srcs = ["timed_threads_test.py"], deps = [ ":timed_threads", "//:expect_tensorflow_installed", - "//keras", - "//keras/testing_infra:test_combinations", - "//keras/testing_infra:test_utils", + "//tf_keras", + "//tf_keras/testing_infra:test_combinations", + "//tf_keras/testing_infra:test_utils", ], ) diff --git a/tf_keras/utils/__init__.py b/tf_keras/utils/__init__.py new file mode 100644 index 000000000..7a26c57d0 --- /dev/null +++ b/tf_keras/utils/__init__.py @@ -0,0 +1,74 @@ +# Copyright 2022 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. +# ============================================================================== +"""Public TF-Keras utilities.""" + +# isort: off + +# Serialization related +from tf_keras.saving.serialization_lib import deserialize_keras_object +from tf_keras.saving.serialization_lib import serialize_keras_object +from tf_keras.saving.object_registration import CustomObjectScope +from tf_keras.saving.object_registration import custom_object_scope +from tf_keras.saving.object_registration import get_custom_objects +from tf_keras.saving.object_registration import get_registered_name +from tf_keras.saving.object_registration import register_keras_serializable + +# Dataset related +from tf_keras.utils.audio_dataset import audio_dataset_from_directory +from tf_keras.utils.text_dataset import text_dataset_from_directory +from tf_keras.utils.timeseries_dataset import timeseries_dataset_from_array +from tf_keras.utils.image_dataset import image_dataset_from_directory +from tf_keras.utils.dataset_utils import split_dataset + +# Sequence related +from tf_keras.utils.data_utils import GeneratorEnqueuer +from tf_keras.utils.data_utils import OrderedEnqueuer +from tf_keras.utils.data_utils import Sequence +from tf_keras.utils.data_utils import SequenceEnqueuer + +# Image related +from tf_keras.utils.image_utils import array_to_img +from tf_keras.utils.image_utils import img_to_array +from tf_keras.utils.image_utils import load_img +from tf_keras.utils.image_utils import save_img + +# Python utils +from tf_keras.utils.tf_utils import set_random_seed +from tf_keras.utils.generic_utils import Progbar +from tf_keras.utils.data_utils import get_file + +# Preprocessing utils +from tf_keras.utils.feature_space import FeatureSpace + +# Internal +from tf_keras.utils.layer_utils import get_source_inputs +from tf_keras.utils.layer_utils import warmstart_embedding_matrix + +# Deprecated +from tf_keras.utils.np_utils import normalize +from tf_keras.utils.np_utils import to_categorical +from tf_keras.utils.np_utils import to_ordinal +from tf_keras.utils.data_utils import pad_sequences + +# Evaluation related +from tf_keras.utils.sidecar_evaluator import SidecarEvaluator +from tf_keras.utils.sidecar_evaluator import SidecarEvaluatorModelExport + +# Timed Thread +from tf_keras.utils.timed_threads import TimedThread + +# Visualization related +from tf_keras.utils.vis_utils import model_to_dot +from tf_keras.utils.vis_utils import plot_model diff --git a/keras/utils/audio_dataset.py b/tf_keras/utils/audio_dataset.py similarity index 99% rename from keras/utils/audio_dataset.py rename to tf_keras/utils/audio_dataset.py index 60d2ec422..295316ab4 100644 --- a/keras/utils/audio_dataset.py +++ b/tf_keras/utils/audio_dataset.py @@ -17,7 +17,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.utils import dataset_utils +from tf_keras.utils import dataset_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/utils/audio_dataset_test.py b/tf_keras/utils/audio_dataset_test.py similarity index 99% rename from keras/utils/audio_dataset_test.py rename to tf_keras/utils/audio_dataset_test.py index c32dda318..9e7efb766 100644 --- a/keras/utils/audio_dataset_test.py +++ b/tf_keras/utils/audio_dataset_test.py @@ -20,9 +20,9 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import audio_dataset +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import audio_dataset @test_utils.run_v2_only diff --git a/keras/utils/audio_dataset_with_tfio_test.py b/tf_keras/utils/audio_dataset_with_tfio_test.py similarity index 97% rename from keras/utils/audio_dataset_with_tfio_test.py rename to tf_keras/utils/audio_dataset_with_tfio_test.py index 75689d29c..83cf0c7fe 100644 --- a/keras/utils/audio_dataset_with_tfio_test.py +++ b/tf_keras/utils/audio_dataset_with_tfio_test.py @@ -20,9 +20,9 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import audio_dataset +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import audio_dataset @test_utils.run_v2_only diff --git a/keras/utils/composite_tensor_support_test.py b/tf_keras/utils/composite_tensor_support_test.py similarity index 98% rename from keras/utils/composite_tensor_support_test.py rename to tf_keras/utils/composite_tensor_support_test.py index 25ce0cfd5..c06f65ea5 100644 --- a/keras/utils/composite_tensor_support_test.py +++ b/tf_keras/utils/composite_tensor_support_test.py @@ -12,21 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras composite tensor support.""" +"""Tests for TF-Keras composite tensor support.""" import numpy as np import scipy.sparse import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.engine import input_layer -from keras.layers import Dense -from keras.layers import Embedding -from keras.layers import Layer -from keras.layers import core -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils +import tf_keras as keras +from tf_keras.engine import input_layer +from tf_keras.layers import Dense +from tf_keras.layers import Embedding +from tf_keras.layers import Layer +from tf_keras.layers import core +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils # Define test-only Layer classes to validate passing Sparse and Ragged tensors @@ -84,7 +84,7 @@ def call(self, inputs): class _SubclassModel(keras.Model): - """A Keras subclass model.""" + """A TF-Keras subclass model.""" def __init__(self, layers, i_layer=None): super().__init__() diff --git a/keras/utils/control_flow_util.py b/tf_keras/utils/control_flow_util.py similarity index 100% rename from keras/utils/control_flow_util.py rename to tf_keras/utils/control_flow_util.py diff --git a/keras/utils/conv_utils.py b/tf_keras/utils/conv_utils.py similarity index 99% rename from keras/utils/conv_utils.py rename to tf_keras/utils/conv_utils.py index 930bbaf9f..1d867ea3b 100644 --- a/keras/utils/conv_utils.py +++ b/tf_keras/utils/conv_utils.py @@ -19,7 +19,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend +from tf_keras import backend def convert_data_format(data_format, ndim): diff --git a/keras/utils/conv_utils_test.py b/tf_keras/utils/conv_utils_test.py similarity index 99% rename from keras/utils/conv_utils_test.py rename to tf_keras/utils/conv_utils_test.py index f7a11ad08..568c344b6 100644 --- a/keras/utils/conv_utils_test.py +++ b/tf_keras/utils/conv_utils_test.py @@ -20,7 +20,7 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.utils import conv_utils +from tf_keras.utils import conv_utils def _get_const_output_shape(input_shape, dim): diff --git a/keras/utils/data_utils.py b/tf_keras/utils/data_utils.py similarity index 99% rename from keras/utils/data_utils.py rename to tf_keras/utils/data_utils.py index 21f48cb8c..8558f0da5 100644 --- a/keras/utils/data_utils.py +++ b/tf_keras/utils/data_utils.py @@ -38,9 +38,9 @@ import tensorflow.compat.v2 as tf from six.moves.urllib.parse import urlsplit -from keras.utils import io_utils -from keras.utils import tf_inspect -from keras.utils.generic_utils import Progbar +from tf_keras.utils import io_utils +from tf_keras.utils import tf_inspect +from tf_keras.utils.generic_utils import Progbar # isort: off from tensorflow.python.util.tf_export import keras_export @@ -92,7 +92,7 @@ def chunk_read(response, chunk_size=8192, reporthook=None): def is_generator_or_sequence(x): - """Check if `x` is a Keras generator type.""" + """Check if `x` is a TF-Keras generator type.""" builtin_iterators = (str, list, tuple, dict, set, frozenset) if isinstance(x, (tf.Tensor, np.ndarray) + builtin_iterators): return False @@ -234,7 +234,7 @@ def get_file( md5 hash of the file for verification file_hash: The expected hash string of the file after download. The sha256 and md5 hash algorithms are both supported. - cache_subdir: Subdirectory under the Keras cache dir where the file is + cache_subdir: Subdirectory under the TF-Keras cache dir where the file is saved. If an absolute path `/path/to/folder` is specified the file will be saved at that location. hash_algorithm: Select the hash algorithm to verify the file. @@ -878,7 +878,7 @@ def init_pool_generator(gens, random_seed=None, id_queue=None): gens: State which should be made available to worker processes. random_seed: An optional value with which to seed child processes. id_queue: A multiprocessing Queue of worker ids. This is used to indicate - that a worker process was created by Keras and can be terminated using + that a worker process was created by TF-Keras and can be terminated using the cleanup_all_keras_forkpools utility. """ global _SHARED_SEQUENCES diff --git a/keras/utils/data_utils_test.py b/tf_keras/utils/data_utils_test.py similarity index 99% rename from keras/utils/data_utils_test.py rename to tf_keras/utils/data_utils_test.py index 093281cda..60dcff72f 100644 --- a/keras/utils/data_utils_test.py +++ b/tf_keras/utils/data_utils_test.py @@ -23,8 +23,8 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.utils import data_utils +import tf_keras as keras +from tf_keras.utils import data_utils class TestGetFile(tf.test.TestCase): diff --git a/keras/utils/dataset_creator.py b/tf_keras/utils/dataset_creator.py similarity index 100% rename from keras/utils/dataset_creator.py rename to tf_keras/utils/dataset_creator.py diff --git a/keras/utils/dataset_creator_test.py b/tf_keras/utils/dataset_creator_test.py similarity index 94% rename from keras/utils/dataset_creator_test.py rename to tf_keras/utils/dataset_creator_test.py index 3fa544238..93bc41ef2 100644 --- a/keras/utils/dataset_creator_test.py +++ b/tf_keras/utils/dataset_creator_test.py @@ -17,14 +17,14 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.distribute import multi_worker_testing_utils -from keras.engine import data_adapter -from keras.engine import sequential -from keras.layers import core as core_layers -from keras.optimizers.legacy import gradient_descent -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import dataset_creator +from tf_keras.distribute import multi_worker_testing_utils +from tf_keras.engine import data_adapter +from tf_keras.engine import sequential +from tf_keras.layers import core as core_layers +from tf_keras.optimizers.legacy import gradient_descent +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import dataset_creator # isort: off from tensorflow.python.distribute.cluster_resolver import ( diff --git a/keras/utils/dataset_utils.py b/tf_keras/utils/dataset_utils.py similarity index 99% rename from keras/utils/dataset_utils.py rename to tf_keras/utils/dataset_utils.py index 3fbe9b9c2..ae7ad3294 100644 --- a/keras/utils/dataset_utils.py +++ b/tf_keras/utils/dataset_utils.py @@ -23,7 +23,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.utils import io_utils +from tf_keras.utils import io_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/utils/dataset_utils_test.py b/tf_keras/utils/dataset_utils_test.py similarity index 99% rename from keras/utils/dataset_utils_test.py rename to tf_keras/utils/dataset_utils_test.py index 1de07df75..6b6cc2964 100644 --- a/keras/utils/dataset_utils_test.py +++ b/tf_keras/utils/dataset_utils_test.py @@ -6,8 +6,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.testing_infra import test_utils -from keras.utils import dataset_utils +from tf_keras.testing_infra import test_utils +from tf_keras.utils import dataset_utils @test_utils.run_v2_only diff --git a/keras/utils/feature_space.py b/tf_keras/utils/feature_space.py similarity index 97% rename from keras/utils/feature_space.py rename to tf_keras/utils/feature_space.py index e52e158da..f956b6306 100644 --- a/keras/utils/feature_space.py +++ b/tf_keras/utils/feature_space.py @@ -16,16 +16,16 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import base_layer -from keras.saving import saving_lib -from keras.saving import serialization_lib -from keras.utils.generic_utils import LazyLoader +from tf_keras import backend +from tf_keras.engine import base_layer +from tf_keras.saving import saving_lib +from tf_keras.saving import serialization_lib +from tf_keras.utils.generic_utils import LazyLoader # isort: off from tensorflow.python.util.tf_export import keras_export -layers = LazyLoader("layers", globals(), "keras.layers") +layers = LazyLoader("layers", globals(), "tf_keras.layers") class Cross: @@ -193,12 +193,12 @@ class FeatureSpace(base_layer.Layer): preprocessed_ds = labeled_dataset.map(lambda x, y: (feature_space(x), y)) ``` - **Basic usage with the Keras Functional API:** + **Basic usage with the TF-Keras Functional API:** ```python - # Retrieve a dict Keras Input objects + # Retrieve a dict TF-Keras Input objects inputs = feature_space.get_inputs() - # Retrieve the corresponding encoded Keras tensors + # Retrieve the corresponding encoded TF-Keras tensors encoded_features = feature_space.get_encoded_features() # Build a Functional model outputs = keras.layers.Dense(1, activation="sigmoid")(encoded_features) @@ -240,7 +240,7 @@ class FeatureSpace(base_layer.Layer): ) ``` - **Specifying your own Keras preprocessing layer:** + **Specifying your own TF-Keras preprocessing layer:** ```python # Let's say that one of the features is a short text paragraph that @@ -249,7 +249,7 @@ class FeatureSpace(base_layer.Layer): "text": ["1st string", "2nd string", "3rd string"], } - # There's a Keras layer for this: TextVectorization. + # There's a TF-Keras layer for this: TextVectorization. custom_layer = layers.TextVectorization(output_mode="tf_idf") # We can use FeatureSpace.feature to create a custom feature @@ -266,7 +266,7 @@ class FeatureSpace(base_layer.Layer): output_vector = feature_space(data) ``` - **Retrieving the underlying Keras preprocessing layers:** + **Retrieving the underlying TF-Keras preprocessing layers:** ```python # The preprocessing layer of each feature is available in `.preprocessors`. @@ -295,7 +295,7 @@ def feature(cls, dtype, preprocessor, output_mode): @classmethod def float(cls, name=None): - from keras.layers.core import identity + from tf_keras.layers.core import identity name = name or backend.unique_object_name("float") preprocessor = identity.Identity( diff --git a/keras/utils/feature_space_test.py b/tf_keras/utils/feature_space_test.py similarity index 98% rename from keras/utils/feature_space_test.py rename to tf_keras/utils/feature_space_test.py index ee3a87702..874849c5c 100644 --- a/keras/utils/feature_space_test.py +++ b/tf_keras/utils/feature_space_test.py @@ -18,11 +18,11 @@ import tensorflow.compat.v2 as tf -import keras -from keras import layers -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import feature_space +import tf_keras as keras +from tf_keras import layers +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import feature_space @test_utils.run_v2_only diff --git a/keras/utils/generic_utils.py b/tf_keras/utils/generic_utils.py similarity index 99% rename from keras/utils/generic_utils.py rename to tf_keras/utils/generic_utils.py index ba58673ee..2046df8aa 100644 --- a/keras/utils/generic_utils.py +++ b/tf_keras/utils/generic_utils.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Python utilities required by Keras.""" +"""Python utilities required by TF-Keras.""" import binascii import codecs @@ -27,8 +27,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.utils import io_utils -from keras.utils import tf_inspect +from tf_keras.utils import io_utils +from tf_keras.utils import tf_inspect # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/utils/generic_utils_test.py b/tf_keras/utils/generic_utils_test.py similarity index 98% rename from keras/utils/generic_utils_test.py rename to tf_keras/utils/generic_utils_test.py index 4ed6242bd..d7a970670 100644 --- a/keras/utils/generic_utils_test.py +++ b/tf_keras/utils/generic_utils_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras generic Python utils.""" +"""Tests for TF-Keras generic Python utils.""" import os @@ -22,12 +22,12 @@ import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.saving import serialization_lib -from keras.saving.legacy import serialization -from keras.testing_infra import test_utils -from keras.utils import generic_utils -from keras.utils import io_utils +import tf_keras as keras +from tf_keras.saving import serialization_lib +from tf_keras.saving.legacy import serialization +from tf_keras.testing_infra import test_utils +from tf_keras.utils import generic_utils +from tf_keras.utils import io_utils class SnakeCaseTest(tf.test.TestCase): diff --git a/keras/utils/image_dataset.py b/tf_keras/utils/image_dataset.py similarity index 99% rename from keras/utils/image_dataset.py rename to tf_keras/utils/image_dataset.py index fef22dda4..deeafb1c7 100644 --- a/keras/utils/image_dataset.py +++ b/tf_keras/utils/image_dataset.py @@ -17,8 +17,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.utils import dataset_utils -from keras.utils import image_utils +from tf_keras.utils import dataset_utils +from tf_keras.utils import image_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/utils/image_dataset_test.py b/tf_keras/utils/image_dataset_test.py similarity index 98% rename from keras/utils/image_dataset_test.py rename to tf_keras/utils/image_dataset_test.py index cc4c26c24..692a6ae2d 100644 --- a/keras/utils/image_dataset_test.py +++ b/tf_keras/utils/image_dataset_test.py @@ -20,10 +20,10 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import image_dataset -from keras.utils import image_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import image_dataset +from tf_keras.utils import image_utils try: import PIL diff --git a/keras/utils/image_utils.py b/tf_keras/utils/image_utils.py similarity index 99% rename from keras/utils/image_utils.py rename to tf_keras/utils/image_utils.py index 94f4ebc2e..b661416c1 100644 --- a/keras/utils/image_utils.py +++ b/tf_keras/utils/image_utils.py @@ -22,7 +22,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend +from tf_keras import backend # isort: off from tensorflow.python.util.tf_export import keras_export @@ -71,12 +71,12 @@ def smart_resize(x, size, interpolation="bilinear"): new code. Prefer `tf.keras.layers.Resizing`, which provides the same functionality as a preprocessing layer and adds `tf.RaggedTensor` support. See the [preprocessing layer guide]( - https://www.tensorflow.org/guide/keras/preprocessing_layers) + https://www.tensorflow.org/guide/tf_keras/preprocessing_layers) for an overview of preprocessing layers. TensorFlow image datasets typically yield images that have each a different size. However, these images need to be batched before they can be - processed by Keras layers. To be batched, images need to share the same + processed by TF-Keras layers. To be batched, images need to share the same height and width. You could simply do: diff --git a/keras/utils/image_utils_test.py b/tf_keras/utils/image_utils_test.py similarity index 99% rename from keras/utils/image_utils_test.py rename to tf_keras/utils/image_utils_test.py index 07e103c00..8ffec18d7 100644 --- a/keras/utils/image_utils_test.py +++ b/tf_keras/utils/image_utils_test.py @@ -22,9 +22,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import image_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import image_utils @test_utils.run_v2_only diff --git a/keras/utils/io_utils.py b/tf_keras/utils/io_utils.py similarity index 91% rename from keras/utils/io_utils.py rename to tf_keras/utils/io_utils.py index 461ac8a18..93b05e18a 100644 --- a/keras/utils/io_utils.py +++ b/tf_keras/utils/io_utils.py @@ -21,7 +21,7 @@ from absl import logging -from keras.utils import keras_logging +from tf_keras.utils import keras_logging # isort: off from tensorflow.python.util.tf_export import keras_export @@ -34,8 +34,8 @@ def enable_interactive_logging(): """Turn on interactive logging. - When interactive logging is enabled, Keras displays logs via stdout. - This provides the best experience when using Keras in an interactive + When interactive logging is enabled, TF-Keras displays logs via stdout. + This provides the best experience when using TF-Keras in an interactive environment such as a shell or a notebook. """ INTERACTIVE_LOGGING.enable = True @@ -45,8 +45,8 @@ def enable_interactive_logging(): def disable_interactive_logging(): """Turn off interactive logging. - When interactive logging is disabled, Keras sends logs to `absl.logging`. - This is the best option when using Keras in a non-interactive + When interactive logging is disabled, TF-Keras sends logs to `absl.logging`. + This is the best option when using TF-Keras in a non-interactive way, such as running a training or inference job on a server. """ INTERACTIVE_LOGGING.enable = False diff --git a/keras/utils/io_utils_test.py b/tf_keras/utils/io_utils_test.py similarity index 97% rename from keras/utils/io_utils_test.py rename to tf_keras/utils/io_utils_test.py index 445bbaab7..831d00d1b 100644 --- a/keras/utils/io_utils_test.py +++ b/tf_keras/utils/io_utils_test.py @@ -20,8 +20,8 @@ import tensorflow.compat.v2 as tf -from keras.testing_infra import test_combinations -from keras.utils import io_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.utils import io_utils class TestIOUtils(test_combinations.TestCase): diff --git a/keras/utils/keras_logging.py b/tf_keras/utils/keras_logging.py similarity index 100% rename from keras/utils/keras_logging.py rename to tf_keras/utils/keras_logging.py diff --git a/keras/utils/kernelized_utils.py b/tf_keras/utils/kernelized_utils.py similarity index 100% rename from keras/utils/kernelized_utils.py rename to tf_keras/utils/kernelized_utils.py diff --git a/keras/utils/kernelized_utils_test.py b/tf_keras/utils/kernelized_utils_test.py similarity index 99% rename from keras/utils/kernelized_utils_test.py rename to tf_keras/utils/kernelized_utils_test.py index cc562325e..c4b6ead41 100644 --- a/keras/utils/kernelized_utils_test.py +++ b/tf_keras/utils/kernelized_utils_test.py @@ -19,7 +19,7 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.utils import kernelized_utils +from tf_keras.utils import kernelized_utils def _exact_gaussian(stddev): diff --git a/keras/utils/kpl_test_utils.py b/tf_keras/utils/kpl_test_utils.py similarity index 98% rename from keras/utils/kpl_test_utils.py rename to tf_keras/utils/kpl_test_utils.py index e96677f44..bbbf46ecc 100644 --- a/keras/utils/kpl_test_utils.py +++ b/tf_keras/utils/kpl_test_utils.py @@ -19,8 +19,8 @@ import tensorflow.compat.v2 as tf -import keras -from keras.layers.preprocessing import string_lookup +import tf_keras as keras +from tf_keras.layers.preprocessing import string_lookup class DistributeKplTestUtils(tf.test.TestCase): diff --git a/keras/utils/layer_utils.py b/tf_keras/utils/layer_utils.py similarity index 99% rename from keras/utils/layer_utils.py rename to tf_keras/utils/layer_utils.py index c15434667..f08c4dc19 100644 --- a/keras/utils/layer_utils.py +++ b/tf_keras/utils/layer_utils.py @@ -23,8 +23,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import initializers -from keras.utils import io_utils +from tf_keras import initializers +from tf_keras.utils import io_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -92,7 +92,7 @@ def validate_string_arg( callable_note = ( f"If restoring a model and `{arg_name}` is a custom callable, " "please ensure the callable is registered as a custom object. " - "See https://www.tensorflow.org/guide/keras/save_and_serialize" + "See https://www.tensorflow.org/guide/tf_keras/save_and_serialize" "#registering_the_custom_object for details. " ) else: @@ -325,7 +325,7 @@ def print_summary( """Prints a summary of a model. Args: - model: Keras model instance. + model: TF-Keras model instance. line_length: Total length of printed lines (e.g. set this to adapt the display to different terminal window sizes). @@ -993,7 +993,7 @@ def warmstart_embedding_matrix( Example: Here is an example that demonstrates how to use the `warmstart_embedding_matrix` util. - >>> import keras + >>> import tf_keras as keras >>> vocab_base = tf.convert_to_tensor(["unk", "a", "b", "c"]) >>> vocab_new = tf.convert_to_tensor( ... ["unk", "unk", "a", "b", "c", "d", "e"]) diff --git a/keras/utils/layer_utils_test.py b/tf_keras/utils/layer_utils_test.py similarity index 99% rename from keras/utils/layer_utils_test.py rename to tf_keras/utils/layer_utils_test.py index 7fd128a9b..d717ee0e6 100644 --- a/keras/utils/layer_utils_test.py +++ b/tf_keras/utils/layer_utils_test.py @@ -30,16 +30,16 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras import backend -from keras import layers -from keras.dtensor import dtensor_api as dtensor -from keras.dtensor import layout_map as layout_map_lib -from keras.dtensor import test_util -from keras.testing_infra import test_utils -from keras.utils import io_utils -from keras.utils import layer_utils -from keras.utils import tf_utils +import tf_keras as keras +from tf_keras import backend +from tf_keras import layers +from tf_keras.dtensor import dtensor_api as dtensor +from tf_keras.dtensor import layout_map as layout_map_lib +from tf_keras.dtensor import test_util +from tf_keras.testing_infra import test_utils +from tf_keras.utils import io_utils +from tf_keras.utils import layer_utils +from tf_keras.utils import tf_utils _PICKLEABLE_CALL_COUNT = collections.Counter() diff --git a/keras/utils/legacy/__init__.py b/tf_keras/utils/legacy/__init__.py similarity index 79% rename from keras/utils/legacy/__init__.py rename to tf_keras/utils/legacy/__init__.py index d4dd953be..7c8e6de80 100644 --- a/keras/utils/legacy/__init__.py +++ b/tf_keras/utils/legacy/__init__.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Legacy public Keras utilities.""" +"""Legacy public TF-Keras utilities.""" # isort: off # Serialization related -from keras.saving.legacy.serialization import deserialize_keras_object -from keras.saving.legacy.serialization import serialize_keras_object +from tf_keras.saving.legacy.serialization import deserialize_keras_object +from tf_keras.saving.legacy.serialization import serialize_keras_object diff --git a/keras/utils/losses_utils.py b/tf_keras/utils/losses_utils.py similarity index 99% rename from keras/utils/losses_utils.py rename to tf_keras/utils/losses_utils.py index 28a450bce..9ebb4182c 100644 --- a/keras/utils/losses_utils.py +++ b/tf_keras/utils/losses_utils.py @@ -17,9 +17,9 @@ import tensorflow.compat.v2 as tf -from keras import backend -from keras.engine import keras_tensor -from keras.utils import tf_utils +from tf_keras import backend +from tf_keras.engine import keras_tensor +from tf_keras.utils import tf_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -396,7 +396,7 @@ def cast_losses_to_common_dtype(losses): def get_mask(y_p): - """Returns Keras mask from tensor.""" + """Returns TF-Keras mask from tensor.""" return getattr(y_p, "_keras_mask", None) diff --git a/keras/utils/losses_utils_test.py b/tf_keras/utils/losses_utils_test.py similarity index 97% rename from keras/utils/losses_utils_test.py rename to tf_keras/utils/losses_utils_test.py index 03c531bf1..838d1a188 100644 --- a/keras/utils/losses_utils_test.py +++ b/tf_keras/utils/losses_utils_test.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras.testing_infra import test_combinations -from keras.utils import losses_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.utils import losses_utils @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/utils/metrics_utils.py b/tf_keras/utils/metrics_utils.py similarity index 99% rename from keras/utils/metrics_utils.py rename to tf_keras/utils/metrics_utils.py index 0edd82d70..38285abbb 100644 --- a/keras/utils/metrics_utils.py +++ b/tf_keras/utils/metrics_utils.py @@ -22,10 +22,10 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras import backend -from keras.utils import losses_utils -from keras.utils import tf_utils -from keras.utils.generic_utils import to_list +from tf_keras import backend +from tf_keras.utils import losses_utils +from tf_keras.utils import tf_utils +from tf_keras.utils.generic_utils import to_list NEG_INF = -1e10 @@ -112,11 +112,11 @@ def decorated(metric_obj, *args): # `variable_sync_on_read_context`, in principle there is no need to use # `merge_call` here. However the branch still exists because: # - # 1. Keras V1 training code sometimes assumes `result_t` is the same + # 1. TF-Keras V1 training code sometimes assumes `result_t` is the same # tensor across replicas (achieved by `merge_call`). With # `variable_sync_on_read_context` each replica gets their own tensors # residing on replica's device, thus breaking the assumption. - # 2. Keras c/fit creates a tf.function (a.k.a, train_function) that + # 2. TF-Keras c/fit creates a tf.function (a.k.a, train_function) that # returns the metric values of the first replica. With # `variable_sync_on_read_context` since each replica gets their own # tensors, the metric result tensors on the non-first replicas are diff --git a/keras/utils/metrics_utils_test.py b/tf_keras/utils/metrics_utils_test.py similarity index 99% rename from keras/utils/metrics_utils_test.py rename to tf_keras/utils/metrics_utils_test.py index e099781b4..4f0b5589d 100644 --- a/keras/utils/metrics_utils_test.py +++ b/tf_keras/utils/metrics_utils_test.py @@ -18,10 +18,10 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras import backend -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import metrics_utils +from tf_keras import backend +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import metrics_utils @test_combinations.generate(test_combinations.combine(mode=["graph", "eager"])) diff --git a/keras/utils/mode_keys.py b/tf_keras/utils/mode_keys.py similarity index 100% rename from keras/utils/mode_keys.py rename to tf_keras/utils/mode_keys.py diff --git a/keras/utils/np_utils.py b/tf_keras/utils/np_utils.py similarity index 100% rename from keras/utils/np_utils.py rename to tf_keras/utils/np_utils.py diff --git a/keras/utils/np_utils_test.py b/tf_keras/utils/np_utils_test.py similarity index 97% rename from keras/utils/np_utils_test.py rename to tf_keras/utils/np_utils_test.py index d108e10dd..1e705fee5 100644 --- a/keras/utils/np_utils_test.py +++ b/tf_keras/utils/np_utils_test.py @@ -18,8 +18,8 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -from keras.testing_infra import test_combinations -from keras.utils import np_utils +from tf_keras.testing_infra import test_combinations +from tf_keras.utils import np_utils NUM_CLASSES = 5 diff --git a/keras/utils/object_identity.py b/tf_keras/utils/object_identity.py similarity index 100% rename from keras/utils/object_identity.py rename to tf_keras/utils/object_identity.py diff --git a/keras/utils/sidecar_evaluator.py b/tf_keras/utils/sidecar_evaluator.py similarity index 97% rename from keras/utils/sidecar_evaluator.py rename to tf_keras/utils/sidecar_evaluator.py index 82b3c1df0..0843fd837 100644 --- a/keras/utils/sidecar_evaluator.py +++ b/tf_keras/utils/sidecar_evaluator.py @@ -21,8 +21,8 @@ # isort: off from tensorflow.python.platform import tf_logging as logging from tensorflow.python.util import deprecation -from keras.callbacks import ModelCheckpoint -from keras.optimizers import optimizer +from tf_keras.callbacks import ModelCheckpoint +from tf_keras.optimizers import optimizer from tensorflow.python.util.tf_export import keras_export _PRINT_EVAL_STEP_EVERY_SEC = 60.0 @@ -60,7 +60,7 @@ class SidecarEvaluator: or more workers performing the training, and saving checkpoints. The `SidecarEvaluator` API is compatible with both Custom Training Loop - (CTL), and Keras `Model.fit` to be used in the training cluster. Using the + (CTL), and TF-Keras `Model.fit` to be used in the training cluster. Using the model (with compiled metrics) provided at `__init__`, `SidecarEvaluator` repeatedly performs evaluation "epochs" when it finds a checkpoint that has not yet been used. Depending on the `steps` argument, an eval epoch is @@ -69,7 +69,7 @@ class SidecarEvaluator: in order to be recognized by `SidecarEvaluator`. Since under the hood, `SidecarEvaluator` uses `model.evaluate` for - evaluation, it also supports arbitrary Keras callbacks. That is, if one or + evaluation, it also supports arbitrary TF-Keras callbacks. That is, if one or more callbacks are provided, their `on_test_batch_begin` and `on_test_batch_end` methods are called at the start and end of a batch, and their `on_test_begin` and `on_test_end` are called at the start and end of @@ -119,7 +119,7 @@ class SidecarEvaluator: checkpoint_manager.save() ``` - If the training cluster uses Keras `Model.fit` API, a + If the training cluster uses TF-Keras `Model.fit` API, a `tf.keras.callbacks.ModelCheckpoint` should be used, with `save_weights_only=True`, and the `filepath` should have 'ckpt-{epoch}' appended: @@ -152,7 +152,7 @@ def __init__( model should have one or more metrics compiled before using `SidecarEvaluator`. data: The input data for evaluation. `SidecarEvaluator` supports all - data types that Keras `model.evaluate` supports as the input data + data types that TF-Keras `model.evaluate` supports as the input data `x`, such as a `tf.data.Dataset`. checkpoint_dir: Directory where checkpoint files are saved. steps: Number of steps to perform evaluation for, when evaluating a @@ -176,7 +176,7 @@ def __init__( terminate evaluator program themselves. callbacks: List of `keras.callbacks.Callback` instances to apply during evaluation. See - [callbacks](/api_docs/python/tf/keras/callbacks). + [callbacks](/api_docs/python/tf/tf_keras/callbacks). """ self.model = model self.data = data @@ -340,7 +340,7 @@ def __init__(self, *args, **kwargs): @keras_export("keras.callbacks.SidecarEvaluatorModelExport") class SidecarEvaluatorModelExport(ModelCheckpoint): - """Callback to save the best Keras model. + """Callback to save the best TF-Keras model. It expands the functionality of the existing ModelCheckpoint callback to enable exporting the best models after evaluation with validation dataset. diff --git a/keras/utils/sidecar_evaluator_test.py b/tf_keras/utils/sidecar_evaluator_test.py similarity index 97% rename from keras/utils/sidecar_evaluator_test.py rename to tf_keras/utils/sidecar_evaluator_test.py index f33639347..c1504c70f 100644 --- a/keras/utils/sidecar_evaluator_test.py +++ b/tf_keras/utils/sidecar_evaluator_test.py @@ -24,13 +24,13 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.optimizers import sgd -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import np_utils -from keras.utils import sidecar_evaluator as sidecar_evaluator_lib -from keras.utils.sidecar_evaluator import SidecarEvaluatorModelExport +import tf_keras as keras +from tf_keras.optimizers import sgd +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import np_utils +from tf_keras.utils import sidecar_evaluator as sidecar_evaluator_lib +from tf_keras.utils.sidecar_evaluator import SidecarEvaluatorModelExport # isort: off from tensorflow.python.platform import tf_logging as logging diff --git a/keras/utils/steps_per_execution_tuning.py b/tf_keras/utils/steps_per_execution_tuning.py similarity index 99% rename from keras/utils/steps_per_execution_tuning.py rename to tf_keras/utils/steps_per_execution_tuning.py index ade47a736..3bebe4ecf 100644 --- a/keras/utils/steps_per_execution_tuning.py +++ b/tf_keras/utils/steps_per_execution_tuning.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Steps per execution autotuning for Keras engine.""" +"""Steps per execution autotuning for TF-Keras engine.""" import logging import threading diff --git a/keras/utils/steps_per_execution_tuning_test.py b/tf_keras/utils/steps_per_execution_tuning_test.py similarity index 94% rename from keras/utils/steps_per_execution_tuning_test.py rename to tf_keras/utils/steps_per_execution_tuning_test.py index 163a20932..54a2d9792 100644 --- a/keras/utils/steps_per_execution_tuning_test.py +++ b/tf_keras/utils/steps_per_execution_tuning_test.py @@ -18,13 +18,13 @@ import tensorflow.compat.v2 as tf -from keras import Input -from keras import Model -from keras import losses -from keras import optimizers -from keras.layers import Dense -from keras.testing_infra import test_combinations -from keras.utils import steps_per_execution_tuning +from tf_keras import Input +from tf_keras import Model +from tf_keras import losses +from tf_keras import optimizers +from tf_keras.layers import Dense +from tf_keras.testing_infra import test_combinations +from tf_keras.utils import steps_per_execution_tuning class mockOptimizer: diff --git a/keras/utils/text_dataset.py b/tf_keras/utils/text_dataset.py similarity index 99% rename from keras/utils/text_dataset.py rename to tf_keras/utils/text_dataset.py index 37ba1a94b..587b53834 100644 --- a/keras/utils/text_dataset.py +++ b/tf_keras/utils/text_dataset.py @@ -17,7 +17,7 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.utils import dataset_utils +from tf_keras.utils import dataset_utils # isort: off from tensorflow.python.util.tf_export import keras_export diff --git a/keras/utils/text_dataset_test.py b/tf_keras/utils/text_dataset_test.py similarity index 98% rename from keras/utils/text_dataset_test.py rename to tf_keras/utils/text_dataset_test.py index 532eb06cf..50349618b 100644 --- a/keras/utils/text_dataset_test.py +++ b/tf_keras/utils/text_dataset_test.py @@ -21,9 +21,9 @@ import tensorflow.compat.v2 as tf -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import text_dataset +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import text_dataset @test_utils.run_v2_only diff --git a/keras/utils/tf_contextlib.py b/tf_keras/utils/tf_contextlib.py similarity index 100% rename from keras/utils/tf_contextlib.py rename to tf_keras/utils/tf_contextlib.py diff --git a/keras/utils/tf_inspect.py b/tf_keras/utils/tf_inspect.py similarity index 100% rename from keras/utils/tf_inspect.py rename to tf_keras/utils/tf_inspect.py diff --git a/keras/utils/tf_utils.py b/tf_keras/utils/tf_utils.py similarity index 97% rename from keras/utils/tf_utils.py rename to tf_keras/utils/tf_utils.py index 2ca549e0c..3ce8d0cc8 100644 --- a/keras/utils/tf_utils.py +++ b/tf_keras/utils/tf_utils.py @@ -25,10 +25,10 @@ import tensorflow.compat.v2 as tf from absl import logging -from keras import backend -from keras.engine import keras_tensor -from keras.utils import object_identity -from keras.utils import tf_contextlib +from tf_keras import backend +from tf_keras.engine import keras_tensor +from tf_keras.utils import object_identity +from tf_keras.utils import tf_contextlib # isort: off from tensorflow.python.framework import ops @@ -40,7 +40,7 @@ def set_random_seed(seed): """Sets all random seeds for the program (Python, NumPy, and TensorFlow). - You can use this utility to make almost any Keras program fully + You can use this utility to make almost any TF-Keras program fully deterministic. Some limitations apply in cases where network communications are involved (e.g. parameter server distribution), which creates additional sources of randomness, or when certain non-deterministic cuDNN ops are @@ -365,7 +365,7 @@ def shape_type_conversion(fn): def wrapper(instance, input_shape): # Pass shapes as tuples to `fn` - # This preserves compatibility with external Keras. + # This preserves compatibility with external TF-Keras. if input_shape is not None: input_shape = convert_shapes(input_shape, to_tuples=True) output_shape = fn(instance, input_shape) @@ -420,7 +420,7 @@ def is_symbolic_tensor(tensor): component_tensors = tf.nest.flatten(tensor, expand_composites=True) return any(hasattr(t, "graph") for t in component_tensors) elif isinstance(tensor, tf.Variable): - # Variables that are output of a Keras Layer in Functional API mode + # Variables that are output of a TF-Keras Layer in Functional API mode # should be considered symbolic. # TODO(omalleyt): We need a better way to check this in order to # enable `run_eagerly=True` for Models containing Layers that @@ -442,7 +442,7 @@ def register_symbolic_tensor_type(cls): Used in conjunction with `tf.register_tensor_conversion_function`, calling `tf.keras.__internal__.utils.register_symbolic_tensor_type(cls)` - allows non-`Tensor` objects to be plumbed through Keras layers. + allows non-`Tensor` objects to be plumbed through TF-Keras layers. Example: @@ -510,7 +510,7 @@ def is_tensor_or_extension_type(x): def convert_variables_to_tensors(values): """Converts `Variable`s in `values` to `Tensor`s. - This is a Keras version of `convert_variables_to_tensors` in TensorFlow + This is a TF-Keras version of `convert_variables_to_tensors` in TensorFlow variable_utils.py. If an object in `values` is an `ExtensionType` and it overrides its @@ -538,7 +538,7 @@ def _convert_resource_variable_to_tensor(x): def assert_no_legacy_layers(layers): - """Prevent tf.layers.Layers from being used with Keras. + """Prevent tf.layers.Layers from being used with TF-Keras. Certain legacy layers inherit from their keras analogs; however they are not supported with keras and can lead to subtle and hard to diagnose bugs. diff --git a/keras/utils/tf_utils_test.py b/tf_keras/utils/tf_utils_test.py similarity index 98% rename from keras/utils/tf_utils_test.py rename to tf_keras/utils/tf_utils_test.py index 023cd123f..174522a4c 100644 --- a/keras/utils/tf_utils_test.py +++ b/tf_keras/utils/tf_utils_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras TF utils.""" +"""Tests for TF-Keras TF utils.""" from unittest.mock import MagicMock from unittest.mock import patch @@ -21,9 +21,9 @@ import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.testing_infra import test_combinations -from keras.utils import tf_utils +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.utils import tf_utils try: import attr @@ -171,7 +171,7 @@ def call(self, inputs, *args, **kwargs): PlumbingLayer(Foo), # Makes a `Foo` object. ] ) - # Let's ensure Keras graph history is preserved by composing the models. + # Let's ensure TF-Keras graph history is preserved by composing the models. model = keras.Model(model.inputs, model(model.outputs)) # Now we instantiate the model and verify we have a `Foo` object, not a # `Tensor`. diff --git a/keras/utils/timed_threads.py b/tf_keras/utils/timed_threads.py similarity index 100% rename from keras/utils/timed_threads.py rename to tf_keras/utils/timed_threads.py diff --git a/keras/utils/timed_threads_test.py b/tf_keras/utils/timed_threads_test.py similarity index 96% rename from keras/utils/timed_threads_test.py rename to tf_keras/utils/timed_threads_test.py index 011603feb..da24fb9c5 100644 --- a/keras/utils/timed_threads_test.py +++ b/tf_keras/utils/timed_threads_test.py @@ -19,10 +19,10 @@ import tensorflow.compat.v2 as tf from absl import logging -import keras -from keras.testing_infra import test_combinations -from keras.testing_infra import test_utils -from keras.utils import timed_threads +import tf_keras as keras +from tf_keras.testing_infra import test_combinations +from tf_keras.testing_infra import test_utils +from tf_keras.utils import timed_threads @test_utils.run_v2_only diff --git a/keras/utils/timeseries_dataset.py b/tf_keras/utils/timeseries_dataset.py similarity index 100% rename from keras/utils/timeseries_dataset.py rename to tf_keras/utils/timeseries_dataset.py diff --git a/keras/utils/timeseries_dataset_test.py b/tf_keras/utils/timeseries_dataset_test.py similarity index 98% rename from keras/utils/timeseries_dataset_test.py rename to tf_keras/utils/timeseries_dataset_test.py index 77f6acd33..7b345afe9 100644 --- a/keras/utils/timeseries_dataset_test.py +++ b/tf_keras/utils/timeseries_dataset_test.py @@ -17,8 +17,8 @@ import numpy as np import tensorflow.compat.v2 as tf -from keras.testing_infra import test_utils -from keras.utils import timeseries_dataset +from tf_keras.testing_infra import test_utils +from tf_keras.utils import timeseries_dataset @test_utils.run_v2_only diff --git a/keras/utils/traceback_utils.py b/tf_keras/utils/traceback_utils.py similarity index 98% rename from keras/utils/traceback_utils.py rename to tf_keras/utils/traceback_utils.py index 6cbc80431..6c8bd0319 100644 --- a/keras/utils/traceback_utils.py +++ b/tf_keras/utils/traceback_utils.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Utilities related to Keras exception stack trace prettifying.""" +"""Utilities related to TF-Keras exception stack trace prettifying.""" import inspect import os diff --git a/keras/utils/traceback_utils_test.py b/tf_keras/utils/traceback_utils_test.py similarity index 98% rename from keras/utils/traceback_utils_test.py rename to tf_keras/utils/traceback_utils_test.py index cb223f38b..a77d3c40e 100644 --- a/keras/utils/traceback_utils_test.py +++ b/tf_keras/utils/traceback_utils_test.py @@ -16,8 +16,8 @@ import tensorflow.compat.v2 as tf -from keras import layers -from keras.utils import traceback_utils +from tf_keras import layers +from tf_keras.utils import traceback_utils class TracebackUtilsTest(tf.test.TestCase): diff --git a/keras/utils/version_utils.py b/tf_keras/utils/version_utils.py similarity index 83% rename from keras/utils/version_utils.py rename to tf_keras/utils/version_utils.py index ba7350921..9a3cfa689 100644 --- a/keras/utils/version_utils.py +++ b/tf_keras/utils/version_utils.py @@ -13,27 +13,27 @@ # limitations under the License. # ============================================================================== -"""Utilities for Keras classes with v1 and v2 versions.""" +"""Utilities for TF-Keras classes with v1 and v2 versions.""" import tensorflow.compat.v2 as tf -from keras.utils.generic_utils import LazyLoader +from tf_keras.utils.generic_utils import LazyLoader # TODO(b/134426265): Switch back to single-quotes once the issue # with copybara is fixed. -training = LazyLoader("training", globals(), "keras.engine.training") -training_v1 = LazyLoader("training_v1", globals(), "keras.engine.training_v1") -base_layer = LazyLoader("base_layer", globals(), "keras.engine.base_layer") +training = LazyLoader("training", globals(), "tf_keras.engine.training") +training_v1 = LazyLoader("training_v1", globals(), "tf_keras.engine.training_v1") +base_layer = LazyLoader("base_layer", globals(), "tf_keras.engine.base_layer") base_layer_v1 = LazyLoader( - "base_layer_v1", globals(), "keras.engine.base_layer_v1" + "base_layer_v1", globals(), "tf_keras.engine.base_layer_v1" ) -callbacks = LazyLoader("callbacks", globals(), "keras.callbacks") -callbacks_v1 = LazyLoader("callbacks_v1", globals(), "keras.callbacks_v1") +callbacks = LazyLoader("callbacks", globals(), "tf_keras.callbacks") +callbacks_v1 = LazyLoader("callbacks_v1", globals(), "tf_keras.callbacks_v1") class ModelVersionSelector: - """Chooses between Keras v1 and v2 Model class.""" + """Chooses between TF-Keras v1 and v2 Model class.""" def __new__(cls, *args, **kwargs): use_v2 = should_use_v2() @@ -42,7 +42,7 @@ def __new__(cls, *args, **kwargs): class LayerVersionSelector: - """Chooses between Keras v1 and v2 Layer class.""" + """Chooses between TF-Keras v1 and v2 Layer class.""" def __new__(cls, *args, **kwargs): use_v2 = should_use_v2() @@ -51,7 +51,7 @@ def __new__(cls, *args, **kwargs): class TensorBoardVersionSelector: - """Chooses between Keras v1 and v2 TensorBoard callback class.""" + """Chooses between TF-Keras v1 and v2 TensorBoard callback class.""" def __new__(cls, *args, **kwargs): use_v2 = should_use_v2() @@ -93,7 +93,7 @@ def swap_class(cls, v2_cls, v1_cls, use_v2): if cls in (v2_cls, v1_cls): return v2_cls if use_v2 else v1_cls - # Recursively search superclasses to swap in the right Keras class. + # Recursively search superclasses to swap in the right TF-Keras class. new_bases = [] for base in cls.__bases__: if ( diff --git a/keras/utils/version_utils_test.py b/tf_keras/utils/version_utils_test.py similarity index 94% rename from keras/utils/version_utils_test.py rename to tf_keras/utils/version_utils_test.py index 6c73cda93..8ece6cfce 100644 --- a/keras/utils/version_utils_test.py +++ b/tf_keras/utils/version_utils_test.py @@ -12,19 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras utilities to split v1 and v2 classes.""" +"""Tests for TF-Keras utilities to split v1 and v2 classes.""" import abc import numpy as np import tensorflow.compat.v2 as tf -import keras -from keras.engine import base_layer -from keras.engine import base_layer_v1 -from keras.engine import training -from keras.engine import training_v1 -from keras.testing_infra import test_combinations +import tf_keras as keras +from tf_keras.engine import base_layer +from tf_keras.engine import base_layer_v1 +from tf_keras.engine import training +from tf_keras.engine import training_v1 +from tf_keras.testing_infra import test_combinations @test_combinations.run_all_keras_modes diff --git a/keras/utils/vis_utils.py b/tf_keras/utils/vis_utils.py similarity index 97% rename from keras/utils/vis_utils.py rename to tf_keras/utils/vis_utils.py index 7cb011599..f5537462a 100644 --- a/keras/utils/vis_utils.py +++ b/tf_keras/utils/vis_utils.py @@ -21,8 +21,8 @@ import tensorflow.compat.v2 as tf -from keras.utils import io_utils -from keras.utils import layer_utils +from tf_keras.utils import io_utils +from tf_keras.utils import layer_utils # isort: off from tensorflow.python.util.tf_export import keras_export @@ -61,8 +61,8 @@ def check_graphviz(): def is_wrapped_model(layer): - from keras.engine import functional - from keras.layers import Wrapper + from tf_keras.engine import functional + from tf_keras.layers import Wrapper return isinstance(layer, Wrapper) and isinstance( layer.layer, functional.Functional @@ -88,10 +88,10 @@ def model_to_dot( show_layer_activations=False, show_trainable=False, ): - """Convert a Keras model to dot format. + """Convert a TF-Keras model to dot format. Args: - model: A Keras model instance. + model: A TF-Keras model instance. show_shapes: whether to display shape information. show_dtype: whether to display layer dtypes. show_layer_names: whether to display layer names. @@ -117,7 +117,7 @@ def model_to_dot( when the layer is trainable and 'NT' when it is not trainable. Returns: - A `pydot.Dot` instance representing the Keras model or + A `pydot.Dot` instance representing the TF-Keras model or a `pydot.Cluster` instance representing nested model if `subgraph=True`. @@ -133,9 +133,9 @@ def model_to_dot( "the model on a batch of data." ) - from keras.engine import functional - from keras.engine import sequential - from keras.layers import Wrapper + from tf_keras.engine import functional + from tf_keras.engine import sequential + from tf_keras.layers import Wrapper if not check_pydot(): raise ImportError( @@ -389,7 +389,7 @@ def plot_model( show_layer_activations=False, show_trainable=False, ): - """Converts a Keras model to dot format and save to a file. + """Converts a TF-Keras model to dot format and save to a file. Example: @@ -408,7 +408,7 @@ def plot_model( ``` Args: - model: A Keras model instance + model: A TF-Keras model instance to_file: File name of the plot image. show_shapes: whether to display shape information. show_dtype: whether to display layer dtypes. diff --git a/keras/utils/vis_utils_test.py b/tf_keras/utils/vis_utils_test.py similarity index 97% rename from keras/utils/vis_utils_test.py rename to tf_keras/utils/vis_utils_test.py index 1665c8b02..41ebd959e 100644 --- a/keras/utils/vis_utils_test.py +++ b/tf_keras/utils/vis_utils_test.py @@ -12,15 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Keras Vis utils.""" +"""Tests for TF-Keras Vis utils.""" import tensorflow.compat.v2 as tf from absl.testing import parameterized -import keras -from keras.applications import efficientnet -from keras.utils import layer_utils -from keras.utils import vis_utils +import tf_keras as keras +from tf_keras.applications import efficientnet +from tf_keras.utils import layer_utils +from tf_keras.utils import vis_utils class ModelToDotFormatTest(tf.test.TestCase, parameterized.TestCase): @@ -231,7 +231,7 @@ def test_layer_range_value_fail(self, layer_range): def test_model_with_tf_op(self): # Test fix for a bug in which inputs to a TFOp layer past the 1st one - # were not connected in the Keras model plot. + # were not connected in the TF-Keras model plot. a = keras.Input((2,)) b = keras.Input((2,)) model = keras.Model(inputs=[a, b], outputs=a + b)