Skip to content

Instantly share code, notes, and snippets.

@surya00060
surya00060 / gist:422feb0acbcc54db697590cd08d00193
Created December 14, 2021 19:11 — forked from yaroslavvb/gist:b73ff35424dd7ab762234620cf583aac
Example of restricting part of graph to run on single core
# try running cpu intensive test on two devices
import tensorflow as tf
import time
def matmul_op():
"""Multiply two matrices together"""
n = 2000
a = tf.ones((n, n), dtype=tf.float32)