Skip to content

Instantly share code, notes, and snippets.

@MinaGabriel
Created April 10, 2020 12:02
Show Gist options
  • Save MinaGabriel/bca6f9ef88c571b1c0bbe318d0a132d9 to your computer and use it in GitHub Desktop.
Save MinaGabriel/bca6f9ef88c571b1c0bbe318d0a132d9 to your computer and use it in GitHub Desktop.
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
#input image is 5 X 5 and 1 channel
input_shape = (1, 1, 5, 5)
tf.summary.trace_on(graph=True, profiler=True)
x = tf.random.normal(input_shape)
print(x.shape)
y = tf.keras.layers.Conv2D(
2, 2, activation='relu', input_shape=input_shape, data_format='channels_first')(x)
print(y.shape)
print(x)
#output 2 feature map 5 X 5 each
print(y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment