# 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"], )