This is a purely mechanical change. All that is done is: * Deleted python/keras/mixed_precision/experimental/__init__.py * All other files in python/keras/mixed_precision/experimental/ are moved one directly up, out of the experimental/ folder * All Python imports, BUILD dependencies, and other references to the old experimental files are adjusted to refer to the new location This changes the API golden files, but there is no API change. The golden files referred to the full paths of the classes in "is_instance" sections, and the full paths have changed. PiperOrigin-RevId: 338345459 Change-Id: I9eefc2bea49b71f26ef7ec3563364a3f1d54abe6
49 lines
1.3 KiB
Python
49 lines
1.3 KiB
Python
# Description:
|
|
# Contains checkpoints and SavedModels for testing purposes.
|
|
|
|
package(
|
|
default_visibility = [
|
|
"//tensorflow/python/keras:__subpackages__",
|
|
"//tensorflow/tools/pip_package:__pkg__",
|
|
],
|
|
licenses = ["notice"], # Apache 2.0
|
|
)
|
|
|
|
exports_files(["LICENSE"])
|
|
|
|
# These files were generated by running the following program with TensorFlow
|
|
# 2.2rc2. The final release of TF 2.2 was not out when this change was created.:
|
|
|
|
# import os
|
|
# import numpy as np
|
|
# import tensorflow as tf
|
|
#
|
|
# tf.random.set_seed(1)
|
|
# opt = tf.keras.optimizers.SGD(0.1, momentum=0.1)
|
|
# opt = tf.keras.mixed_precision.experimental.LossScaleOptimizer(opt, 'dynamic')
|
|
# model = tf.keras.Sequential([tf.keras.layers.Dense(2)])
|
|
# model.compile(opt, 'mse')
|
|
#
|
|
# x = np.ones((10, 2))
|
|
# y = x * 100
|
|
# model.fit(x, y)
|
|
# weight_dir = os.environ['TF_LSO_WEIGHT_DIR']
|
|
# model_dir = os.environ['TF_LSO_MODEL_DIR']
|
|
# model.save_weights(weight_dir)
|
|
# model.save(model_dir)
|
|
# print(model.get_weights()[0])
|
|
# print(opt._optimizer.get_slot(model.weights[0], 'momentum'))
|
|
# print(opt.loss_scale)
|
|
|
|
filegroup(
|
|
name = "lso_ckpt_tf2.2",
|
|
srcs = glob(["lso_ckpt_tf2.2/**"]),
|
|
tags = ["no_pip"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "lso_savedmodel_tf2.2",
|
|
srcs = glob(["lso_savedmodel_tf2.2/**"]),
|
|
tags = ["no_pip"],
|
|
)
|