diff --git a/tutorials/notebook/debugging_in_pynative_mode.ipynb b/tutorials/notebook/debugging_in_pynative_mode.ipynb
index 9b523f43fa66500891b9b39b5299ccf85f15b0dd..d6c6f81bf49ab31481c9ee4f64375f31ff49f9f8 100644
--- a/tutorials/notebook/debugging_in_pynative_mode.ipynb
+++ b/tutorials/notebook/debugging_in_pynative_mode.ipynb
@@ -362,6 +362,7 @@
    "outputs": [],
    "source": [
     "from mindspore import context, Tensor, ParameterTuple\n",
+    "context.set_context(mode=context.PYNATIVE_MODE, device_target = \"GPU\")\n",
     "\n",
     "class GradWrap(nn.Cell):\n",
     "    \"\"\" GradWrap definition \"\"\"\n",