Skip to content

Commit 2022f26

Browse files
qlzh727tensorflower-gardener
authored andcommitted
Update Keras to use public TF API to retrieve the build info.
PiperOrigin-RevId: 339309293 Change-Id: I68180d802294ab1dbc53837e7219a2c04f6043c8
1 parent 95ed4d8 commit 2022f26

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

tensorflow/python/keras/layers/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ py_library(
421421
"//tensorflow/python:math_ops",
422422
"//tensorflow/python:nn",
423423
"//tensorflow/python:platform",
424-
"//tensorflow/python:platform_build_info",
425424
"//tensorflow/python:resource_variable_ops",
426425
"//tensorflow/python:state_ops",
427426
"//tensorflow/python:util",

tensorflow/python/keras/layers/recurrent_v2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from tensorflow.python.ops import resource_variable_ops
4040
from tensorflow.python.ops import state_ops
4141
from tensorflow.python.ops import variables
42-
from tensorflow.python.platform import build_info
42+
from tensorflow.python.platform import sysconfig
4343
from tensorflow.python.platform import tf_logging as logging
4444
from tensorflow.python.util.tf_export import keras_export
4545

@@ -650,7 +650,7 @@ def gpu_gru(inputs, init_h, kernel, recurrent_kernel, bias, mask, time_major,
650650
# (6 * units)
651651
bias = array_ops.split(K.flatten(bias), 6)
652652

653-
if build_info.build_info['is_cuda_build']:
653+
if sysconfig.get_build_info()['is_cuda_build']:
654654
# Note that the gate order for CuDNN is different from the canonical format.
655655
# canonical format is [z, r, h], whereas CuDNN is [r, z, h]. The swap need
656656
# to be done for kernel, recurrent_kernel, input_bias, recurrent_bias.
@@ -1454,7 +1454,7 @@ def gpu_lstm(inputs, init_h, init_c, kernel, recurrent_kernel, bias, mask,
14541454
# so that mathematically it is same as the canonical LSTM implementation.
14551455
full_bias = array_ops.concat((array_ops.zeros_like(bias), bias), 0)
14561456

1457-
if build_info.build_info['is_rocm_build']:
1457+
if sysconfig.get_build_info()['is_rocm_build']:
14581458
# ROCm MIOpen's weight sequence for LSTM is different from both canonical
14591459
# and Cudnn format
14601460
# MIOpen: [i, f, o, c] Cudnn/Canonical: [i, f, c, o]

0 commit comments

Comments
 (0)