Skip to content

Instantly share code, notes, and snippets.

@siva2k16
Last active August 6, 2019 06:41
import tensorflow as tf
# 25 data points
# Each point with 32 random elements in it
z = tf.random.normal([5,5,1,32])
#5 x 5 matrix
#Each 1 x 32
sess = tf.Session()
result = sess.run(z)
print(result.shape)
z = tf.random.normal([2,2,1,3])
sess = tf.Session()
result = sess.run(z)
print(result.shape)
print(result)
import numpy as np
#Reshape 100 elements into 10 batches of 2 x 5
a = np.arange(100).reshape((-1,10,2,5))
print(a)
#Reshape 100 elements into 5 batches of 1 x 20
a = np.arange(100).reshape((-1,5,1,20))
print(a)
#Reshape 100 elements into 20 batches of 1 x 5
a = np.arange(100).reshape((-1,20,1,5))
print(a)
#Reshape 100 elements into 20 batches of 1 x 5
a = np.arange(100).reshape((-1,20,1,5))
b = a.reshape(-1,100)
print(b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment