Change so that tf.random_poisson is renamed to the v2 API instead of to compat
PiperOrigin-RevId: 229150058
This commit is contained in:
parent
4ac9bda9d0
commit
267263629f
@ -478,7 +478,6 @@ renames = {
|
|||||||
'tf.random_crop': 'tf.image.random_crop',
|
'tf.random_crop': 'tf.image.random_crop',
|
||||||
'tf.random_gamma': 'tf.random.gamma',
|
'tf.random_gamma': 'tf.random.gamma',
|
||||||
'tf.random_normal': 'tf.random.normal',
|
'tf.random_normal': 'tf.random.normal',
|
||||||
'tf.random_poisson': 'tf.compat.v1.random_poisson',
|
|
||||||
'tf.random_shuffle': 'tf.random.shuffle',
|
'tf.random_shuffle': 'tf.random.shuffle',
|
||||||
'tf.random_uniform': 'tf.random.uniform',
|
'tf.random_uniform': 'tf.random.uniform',
|
||||||
'tf.read_file': 'tf.io.read_file',
|
'tf.read_file': 'tf.io.read_file',
|
||||||
|
@ -601,6 +601,8 @@ class TFAPIChangeSpec(ast_edits.APIChangeSpec):
|
|||||||
"tf.compat.v1.initializers.truncated_normal",
|
"tf.compat.v1.initializers.truncated_normal",
|
||||||
"tf.image.resize_images":
|
"tf.image.resize_images":
|
||||||
"tf.image.resize",
|
"tf.image.resize",
|
||||||
|
"tf.random_poisson":
|
||||||
|
"tf.random.poisson",
|
||||||
}
|
}
|
||||||
# pylint: enable=line-too-long
|
# pylint: enable=line-too-long
|
||||||
|
|
||||||
|
@ -539,6 +539,15 @@ bazel-bin/tensorflow/tools/compatibility/update/generate_v2_reorders_map
|
|||||||
)
|
)
|
||||||
self.assertEqual(new_text, expected_text)
|
self.assertEqual(new_text, expected_text)
|
||||||
|
|
||||||
|
def testRandomPoissonConversion(self):
|
||||||
|
text1 = "tf.random_poisson(lam, shape, dtype)"
|
||||||
|
text2 = "tf.random.poisson(lam, shape, dtype)"
|
||||||
|
expected_text = "tf.random.poisson(lam=lam, shape=shape, dtype=dtype)"
|
||||||
|
_, unused_report, unused_errors, new_text1 = self._upgrade(text1)
|
||||||
|
self.assertEqual(new_text1, expected_text)
|
||||||
|
_, unused_report, unused_errors, new_text2 = self._upgrade(text2)
|
||||||
|
self.assertEqual(new_text2, expected_text)
|
||||||
|
|
||||||
def testConvolutionOpUpdate(self):
|
def testConvolutionOpUpdate(self):
|
||||||
text = (
|
text = (
|
||||||
"tf.nn.convolution(input, filter, padding, strides, dilation_rate, "
|
"tf.nn.convolution(input, filter, padding, strides, dilation_rate, "
|
||||||
|
Loading…
Reference in New Issue
Block a user