Skip to content

Commit 5220044

Browse files
arjungtensorflow-copybara
authored andcommitted
Replace deprecated API in NSL tutorials when checking for GPU availability.
PiperOrigin-RevId: 306457313
1 parent 1c5a613 commit 5220044

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

g3doc/tutorials/graph_keras_lstm_imdb.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@
182182
"print(\"Version: \", tf.__version__)\n",
183183
"print(\"Eager mode: \", tf.executing_eagerly())\n",
184184
"print(\"Hub version: \", hub.__version__)\n",
185-
"print(\"GPU is\", \"available\" if tf.test.is_gpu_available() else \"NOT AVAILABLE\")"
185+
"print(\n",
186+
" \"GPU is\",\n",
187+
" \"available\" if tf.config.list_physical_devices(\"GPU\") else \"NOT AVAILABLE\")"
186188
]
187189
},
188190
{

g3doc/tutorials/graph_keras_mlp_cora.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@
174174
"\n",
175175
"print(\"Version: \", tf.__version__)\n",
176176
"print(\"Eager mode: \", tf.executing_eagerly())\n",
177-
"print(\"GPU is\", \"available\" if tf.test.is_gpu_available() else \"NOT AVAILABLE\")"
177+
"print(\n",
178+
" \"GPU is\",\n",
179+
" \"available\" if tf.config.list_physical_devices(\"GPU\") else \"NOT AVAILABLE\")"
178180
]
179181
},
180182
{

0 commit comments

Comments
 (0)