<commit_before>import json
import sys
import numpy as np
import tensorflow as tf

# Read in data from file
data = np.genfromtxt(sys.argv[1], delimiter=',')
data = np.reshape(data,(2,2))

# Generate graph of gpu computations
graph = tf.Graph()
with graph.as_default():
    with tf.device('/gpu:0'):
        X = tf.placeholder("float64",[2,2])
        npmatrix = np.array([[10.0, 2.0], [-5.0, 8.78]])
        matrix = tf.Variable(npmatrix)
        y = tf.matmul(X, matrix)

    # Run the computations on the input
    with tf.Session() as sess:
        sess.run(tf.global_variables_initializer())
        output = sess.run(y, {X: data})

# print out results
print(json.dumps(output.flatten()))<commit_msg>convert numpy array to regular list<commit_after>import json
import sys
import numpy as np
import tensorflow as tf

# Read in data from file
data = np.genfromtxt(sys.argv[1], delimiter=',')
data = np.reshape(data,(2,2))

# Generate graph of gpu computations
graph = tf.Graph()
with graph.as_default():
    with tf.device('/gpu:0'):
        X = tf.placeholder("float64",[2,2])
        npmatrix = np.array([[10.0, 2.0], [-5.0, 8.78]])
        matrix = tf.Variable(npmatrix)
        y = tf.matmul(X, matrix)

    # Run the computations on the input
    with tf.Session() as sess:
        sess.run(tf.global_variables_initializer())
        output = sess.run(y, {X: data})

# print out results
print(json.dumps(output.flatten().tolist()))
{'fraction_non_alphanumeric': 0.14961725817675714, 'fraction_numerical': 0.025052192066805846, 'mean_word_length': 3.370820668693009, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2934764', 'n_tokens_mistral': 503, 'n_tokens_neox': 484, 'n_words': 132}