As an example the code can be executed as follows:
.. code:: shell
python 1-welcome.py --log_dir='~/log_dir'
The ``--log_dir`` flag is to provide the address which the event files (for visualizing in Tensorboard) will be saved. The flag of ``--log_dir`` is not required because its default value is available in the source code as follows:
TensorBoard is the graph visualization tools provided by TensorFlow. Using `Google’s words`_: “The computations you'll use TensorFlow for - like training a massive deep neural network - can be complex and confusing. To make it easier to understand,
debug, and optimize TensorFlow programs, we've included a suite of visualization tools called
TensorBoard.”
The Tensorboard can be run as follows in the terminal:
"This part is not much different compared to what we learned so far. However, it would be nice to try extracting as much information as we can from a multi-dimentional tensor.\n",
"\n",
"\n",
"Let's use [tf.ones](https://www.tensorflow.org/api_docs/python/tf/ones) for our purpose here. It creates an all-one tensor."
"# From second row to last and from third column to last\n",
"print(x[1:,2:].numpy)"
],
"execution_count": 21,
"outputs": [
{
"output_type": "stream",
"text": [
"<bound method _EagerTensorBase.numpy of <tf.Tensor: shape=(1, 1), dtype=int32, numpy=array([[6]], dtype=int32)>>\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Y_zEE3-7iUmu"
},
"source": [
"### Data types\n",
"\n",
"You can change the data type of the tesnorflow tensors for your purpose. This will be done easily by [tf.cast](https://www.tensorflow.org/api_docs/python/tf/cast)."