{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d5089f4c",
   "metadata": {},
   "outputs": [],
   "source": [
    "import tensorflow as tf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "2d35ddfb",
   "metadata": {},
   "outputs": [],
   "source": [
    "#%tensorflow_version x.x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "c3f6ddcb",
   "metadata": {},
   "outputs": [],
   "source": [
    "s= tf.Variable('abc')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "969c3fe4",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import sys"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a02b3d7b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "c7387f28",
   "metadata": {},
   "outputs": [],
   "source": [
    "ar= tf.Variable([[1,2,3],[4,5,6],[7,5,6],[7,8,6]])\n",
    "br= tf.Variable([['a','b'],['c','d']], tf.string)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "46fc1da9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "TensorShape([4, 3])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ar.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "7cb14a0f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "TensorShape([2, 2])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "br.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8175657a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "45888d6a",
   "metadata": {},
   "outputs": [],
   "source": [
    "ones= tf.ones([2,4])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "d9d2746a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0 1 2 ... 7 8 9]\r\n"
     ]
    }
   ],
   "source": [
    "tensor = tf.range(10)\n",
    "tf.print(tensor, output_stream=sys.stderr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "da15bac6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0 1 2 ... 7 8 9]\r\n"
     ]
    }
   ],
   "source": [
    "tensor = tf.range(10)\n",
    "tf.print(tensor)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "ef636feb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0 1 2 ... 7 8 9]\r\n"
     ]
    }
   ],
   "source": [
    "import tensorflow as tf\n",
    "import sys\n",
    "\n",
    "tensor = tf.range(10)\n",
    "tf.print(tensor, output_stream=sys.stderr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "d263b7d7",
   "metadata": {},
   "outputs": [],
   "source": [
    "arr= np.arange(1,31).reshape(-1,2,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "6d428297",
   "metadata": {},
   "outputs": [],
   "source": [
    "tensor= tf.Variable(arr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "347a39a6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "array([[[ 1,  2,  3],\n",
      "        [ 4,  5,  6]],\n",
      "\n",
      "       [[ 7,  8,  9],\n",
      "        [10, 11, 12]],\n",
      "\n",
      "       [[13, 14, 15],\n",
      "        [16, 17, 18]],\n",
      "\n",
      "       [[19, 20, 21],\n",
      "        [22, 23, 24]],\n",
      "\n",
      "       [[25, 26, 27],\n",
      "        [28, 29, 30]]])\r\n"
     ]
    }
   ],
   "source": [
    "tf.print(arr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "1c24f1b8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 9, 12],\n",
       "       [15, 18]])"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "arr[1:3,:,-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3dd62479",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
