Skip to content

Instantly share code, notes, and snippets.

@dare0021
Created January 29, 2019 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dare0021/fd91e5354951d58bccdaa2835105fccd to your computer and use it in GitHub Desktop.
Save dare0021/fd91e5354951d58bccdaa2835105fccd to your computer and use it in GitHub Desktop.
import tensorflow as tf
gpu_fraction = 0.1
vector_size = 100
n = 1
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=gpu_fraction)
config = tf.ConfigProto(gpu_options=gpu_options)
for i in range(n):
with tf.Session(config=config) as sess:
a = tf.random.normal([vector_size])
b = tf.random.normal([vector_size])
sess.run(a+b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment