<jupyter_start><jupyter_text>Copyright 2017 Google LLC.<jupyter_code># Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.<jupyter_output><empty_output><jupyter_text>Prework: Hello World **Learning Objective:** Run a TensorFlow program in the browser. Here is a "Hello World" TensorFlow program:<jupyter_code>import tensorflow as tf

c = tf.constant('Hello, world!')

with tf.Session() as sess:

    print(sess.run(c))<jupyter_output>b'Hello, world!'<jupyter_text>To Run This Program  1. Click anywhere in the code block (for example, on the word `import`).  2. Click the right-facing-triangle icon in the upper-left corner of the code block, or hit ⌘/Ctrl-Enter.     The program will take a few seconds to run. If all goes well, the program will write the phrase `Hello, world!` just below the code blockThis entire program consists of a single code block. However, most exercises consist of multiple code blocks, in which case you should **run the code blocks individually in sequence, from top to bottom.** Running the code blocks out of sequence typically causes errors.  Useful Keyboard Shortcuts* **⌘/Ctrl+m,b:** creates an empty code cell below the cell that's currently selected* **⌘/Ctrl+m,i:** interrupts a running cell* **⌘/Ctrl+m,h:** shows a list of all keyboard shortcuts* For documentation on any TensorFlow API method, write help(function):<jupyter_code>help(tf.constant)<jupyter_output>Help on function constant in module tensorflow.python.framework.constant_op:

constant(value, dtype=None, shape=None, name='Const', verify_shape=False)
    Creates a constant tensor.
    
    The resulting tensor is populated with values of type `dtype`, as
    specified by arguments `value` and (optionally) `shape` (see examples
    below).
    
    The argument `value` can be a constant value, or a list of values of type
    `dtype`. If `value` is a list, then the length of the list must be less
    than or equal to the number of elements implied by the `shape` argument (if
    specified). In the case where the list length is less than the number of
    elements specified by `shape`, the last element in the list will be used
    to fill the remaining entries.
    
    The argument `shape` is optional. If present, it specifies the dimensions of
    the resulting tensor. If not present, the shape of `value` is used.
    
    If the argument `dtype` is not specified, then the type is in[...]
{'fraction_non_alphanumeric': 0.0773747841105354, 'fraction_numerical': 0.0034542314335060447, 'mean_word_length': 4.333333333333333, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '156427', 'license': 'Apache-2.0', 'n_tokens_mistral': 787, 'n_tokens_neox': 770, 'n_words': 397, 'path': '1.hello_world.ipynb', 'repo_name': 'amitbcp/google-machine-learning-course-exercises', 'size': '2895'}