Ones

Sat 17 May 2025

title: "Ones" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


import tensorflow as tf

import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
a = tf.ones([2, 5])
a
<tf.Tensor 'ones:0' shape=(2, 5) dtype=float32>
with tf.Session …

Category: tensorflow-work

Read More

Placeholders

Sat 17 May 2025

title: "Add Method" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


import tensorflow as tf

import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
# Initialize global variables

init_op = tf.global_variables_initializer()
session = tf.Session()
session.run(init_op)
a = tf.placeholder(tf.float32 …

Category: tensorflow-work

Read More

Print In Tensorflow

Sat 17 May 2025

title: "Print in Tensorflow" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


import tensorflow as tf

import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
a = tf.Variable([[1, 2, 3]])
init = (tf.global_variables_initializer(), tf.local_variables_initializer())
sess = tf.Session()
sess.run …

Category: tensorflow-work

Read More

Print Tensorflow

Sat 17 May 2025

title: "Print in Tensorflow" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


import tensorflow as tf

import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
sess = tf.InteractiveSession()
sess
<tensorflow.python.client.session.InteractiveSession at 0x12b796668>
a = tf.constant([12.0 …

Category: tensorflow-work

Read More

Print Values

Sat 17 May 2025

title: "Print Values" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


import tensorflow as tf

import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
normal_rv = tf.Variable(tf.truncated_normal([2, 3], stddev=0.1))
# Initialize the variables
init_op = tf.initialize_all_variables()
with …

Category: tensorflow-work

Read More

Reshape

Sat 17 May 2025

title: "Reshape" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


import tensorflow as tf

import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
tf.InteractiveSession()

a = tf.zeros((2, 2))
b = tf.ones((2, 2))

abc = tf.reduce_sum(b, reduction_indices=1 …

Category: tensorflow-work

Read More

Reshape-1

Sat 17 May 2025

title: "Reshape Extra" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


import tensorflow as tf

import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
a = tf.constant([1, 2, 3, 4, 5, 6, 7, 9])
b = tf.reshape(a, [2, 4 …

Category: tensorflow-work

Read More

Session-2

Sat 17 May 2025

title: "Session 2" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


import tensorflow as tf

import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
a = tf.constant(1.2)
b = tf.constant(2.8)
c = a + b
c
<tf.Tensor 'add …

Category: tensorflow-work

Read More

Session-And-With-Block

Sat 17 May 2025

title: "Session and With Block" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


import tensorflow as tf

import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
a = tf.Variable(2)
b = a * 4
b
<tf.Tensor 'mul:0' shape=() dtype=int32 …

Category: tensorflow-work

Read More

Simple-Calculation-Graph

Sat 17 May 2025

title: "Template" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


import tensorflow as tf

import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
# a = (b + c) * (c + 2)
const = tf.constant(2.0, name='const')
# create variables
b = tf.Variable(2 …

Category: tensorflow-work

Read More
Page 2 of 3

« Prev Next »