def test_relu(self): # make sure its the same as tensorflow x = np.array([-1., 2., 3., 4.]) astroNN_x = relu(x) with tf.device("/cpu:0"), context.eager_mode(): tf_x = tf.nn.relu(tf.convert_to_tensor(x)) npt.assert_array_equal(tf_x.numpy(), astroNN_x)
def test_relu(self): # make sure its the same as tensorflow x = np.array([-1., 2., 3., 4.]) tf_x = tf.nn.relu(tf.convert_to_tensor(x)) astroNN_x = relu(x) npt.assert_array_equal(tf_x.eval(session=get_session()), astroNN_x)
def test_relu(self): # make sure its the same as tensorflow x = np.array([-1., 2., 3., 4.]) astroNN_x = relu(x) tf_x = tf.nn.relu(tf.convert_to_tensor(x)) npt.assert_array_equal(tf_x.numpy(), astroNN_x)