<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 代碼預熱 - Hello TensorFlow 作為學習任何新編程語言,庫或平臺的習慣傳統,讓我們在深入探討之前編寫簡單的 Hello TensorFlow 代碼作為熱身練習。 我們假設您已經安裝了 TensorFlow。 如果還沒有,請參閱 [https://www.tensorflow.org/install/](https://www.tensorflow.org/install/) 上的 TensorFlow 安裝指南,了解安裝 TensorFlow 的詳細說明。 打開 Jupyter Notebook 中的文件`ch-01_TensorFlow_101.ipynb`,在學習文本時關注并運行代碼。 1. 使用以下代碼導入 TensorFlow 庫: ```py import tensorflow as tf ``` 1. 獲取 TensorFlow 會話。 TensorFlow 提供兩種會話:`Session()`和`InteractiveSession()`。我們將使用以下代碼創建交互式會話: ```py tfs = tf.InteractiveSession() ``` `Session()`和`InteractiveSession()`之間的唯一區別是用`InteractiveSession()`創建的會話成為默認會話。因此,我們不需要指定會話上下文以便稍后執行與會話相關的命令。例如,假設我們有一個會話對象`tfs`和一個常量對象`hello`。如果`tfs`是一個`InteractiveSession()`對象,那么我們可以使用代碼`hello.eval()`來評估`hello`。如果`tfs`是`Session()`對象,那么我們必須使用`tfs.hello.eval()`或`with`塊。最常見的做法是使用`with`塊,這將在本章后面介紹。 1. 定義 TensorFlow 常量,`hello`: ```py hello = tf.constant("Hello TensorFlow !!") ``` 1. 在 TensorFlow 會話中執行常量并打印輸出: ```py print(tfs.run(hello)) ``` 1. 您將獲得以下輸出: ```py 'Hello TensorFlow !!' ``` 現在您已經使用 TensorFlow 編寫并執行了前兩行代碼,讓我們來看看 TensorFlow 的基本組成部分。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看