Remove usage of deprecated layer method.
PiperOrigin-RevId: 427339701
This commit is contained in:
parent
bb153c1f9d
commit
cd38172f35
2 changed files with 3 additions and 2 deletions
|
@ -132,7 +132,8 @@ class DPOptimizerTest(tf.test.TestCase, parameterized.TestCase):
|
||||||
|
|
||||||
def linear_model_fn(features, labels, mode):
|
def linear_model_fn(features, labels, mode):
|
||||||
preds = tf.keras.layers.Dense(
|
preds = tf.keras.layers.Dense(
|
||||||
1, activation='linear', name='dense').apply(features['x'])
|
1, activation='linear', name='dense')(
|
||||||
|
features['x'])
|
||||||
|
|
||||||
vector_loss = tf.math.squared_difference(labels, preds)
|
vector_loss = tf.math.squared_difference(labels, preds)
|
||||||
scalar_loss = tf.reduce_mean(input_tensor=vector_loss)
|
scalar_loss = tf.reduce_mean(input_tensor=vector_loss)
|
||||||
|
|
|
@ -41,7 +41,7 @@ class UtilsTest(absltest.TestCase):
|
||||||
del labels
|
del labels
|
||||||
|
|
||||||
input_layer = tf.reshape(features['x'], [-1, self.ndim])
|
input_layer = tf.reshape(features['x'], [-1, self.ndim])
|
||||||
logits = tf.keras.layers.Dense(self.nclass).apply(input_layer)
|
logits = tf.keras.layers.Dense(self.nclass)(input_layer)
|
||||||
|
|
||||||
# Define the PREDICT mode becasue we only need that
|
# Define the PREDICT mode becasue we only need that
|
||||||
if mode == tf.estimator.ModeKeys.PREDICT:
|
if mode == tf.estimator.ModeKeys.PREDICT:
|
||||||
|
|
Loading…
Reference in a new issue