import tensorflow as tf

    vector_batch_as_matricies = tf.expand_dims(vector, [1])
    mult_result = tf.matmul(vector_batch_as_matricies, matrix)
    squeezed_result = tf.squeeze(mult_result, [1])
    return squeezed_result

def euclidean_loss_layer(a, b, multiplier=100.0, use_l1=False, eps=0.01):
    """ Math:  out = (action - mlp_out)'*precision*(action-mlp_out)
                    = (u-uhat)'*A*(u-uhat)"""
    multiplier = tf.constant(multiplier, dtype='float') #for bc #10000
    uP =a*multiplier-b*multiplier
    if use_l1:
        return tf.reduce_mean(eps*tf.square(uP) + tf.abs(uP))
    return tf.reduce_mean(tf.square(uP))

def conv2d(img, w, b, strides=[1, 1, 1, 1], is_dilated=False):
    if is_dilated:
