Skip to content

Instantly share code, notes, and snippets.

@akki2825
Created January 28, 2017 11:04
Show Gist options
  • Save akki2825/6d98e300d15a11620250a814f2299f88 to your computer and use it in GitHub Desktop.
Save akki2825/6d98e300d15a11620250a814f2299f88 to your computer and use it in GitHub Desktop.
from __future__ import print_function
import tensorflow as tf
a= tf.constant(2)
b = tf.constant(3)
with tf.Session() as sess:
print("a=2, b=3")
print("Addition with constants: %i" % sess.run(a+b))
print("Multiplication with constants: %i" % sess.run(a*b))
a= tf.placeholder(tf.int16)
b = tf.placeholder(tf.int16)
add = tf.add(a, b)
mul = tf.mul(a, b)
with tf.Sesssion() as sess:
print("Addition with variables:%i" % sess.run(add, feed_dict = {a: 2, b: 3}))
print("Multiplication with variables: %i" %sess.run(mul, feed_dict = {a: 3, b: 3}))
matrix1= tf.constant([[3.,3.]])
matrix2 = tf.constant([[2.],[2.]])
product = tf.matmul(matrix1, matrix2)
with tf.Session() as sess:
result = sess.run(product)
print(result)
wp_embed_register_handler( 'gist', '/https?:\/\/gist\.github\.com\/([a-z0-9]+)(\?file=.*)?/i', 'bhww_embed_handler_gist' );
function bhww_embed_handler_gist( $matches, $attr, $url, $rawattr ) {
$embed = sprintf(
'<script src="https://gist.github.com/%1$s.js%2$s"></script>',
esc_attr($matches[1]),
esc_attr($matches[2])
);
return apply_filters( 'embed_gist', $embed, $matches, $attr, $url, $rawattr );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment