Spaces:
Runtime error
Runtime error
Commit
·
feb90ac
1
Parent(s):
7d34933
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,19 +4,26 @@ import tensorflow as tf
|
|
| 4 |
from tf_coder.value_search import colab_interface
|
| 5 |
from tf_coder.value_search import value_search_settings as settings_module
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
[
|
| 13 |
-
|
| 14 |
-
[31, 32, 33, 34]]
|
| 15 |
-
''')
|
| 16 |
-
|
| 17 |
-
constants = st.text_input('A list of relevant scalar constants, if any.', placeholder='[]' )
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
settings = settings_module.from_dict({
|
| 22 |
'timeout': 300,
|
|
@@ -25,5 +32,5 @@ settings = settings_module.from_dict({
|
|
| 25 |
'require_all_inputs_used': True,
|
| 26 |
'require_one_input_used': False,
|
| 27 |
})
|
| 28 |
-
|
| 29 |
st.write(colab_interface.run_value_search_from_colab(inputs, output, constants, description, settings))
|
|
|
|
| 4 |
from tf_coder.value_search import colab_interface
|
| 5 |
from tf_coder.value_search import value_search_settings as settings_module
|
| 6 |
|
| 7 |
+
def get_problem():
|
| 8 |
+
"""Specifies a problem to run TF-Coder on. Edit this function!"""
|
| 9 |
+
# A dict mapping input variable names to input tensors.
|
| 10 |
+
inputs = {
|
| 11 |
+
'rows': [10, 20, 30],
|
| 12 |
+
'cols': [1, 2, 3, 4],
|
| 13 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
# The single desired output tensor.
|
| 16 |
+
output = [[11, 12, 13, 14],
|
| 17 |
+
[21, 22, 23, 24],
|
| 18 |
+
[31, 32, 33, 34]]
|
| 19 |
+
|
| 20 |
+
# A list of relevant scalar constants (if any).
|
| 21 |
+
constants = []
|
| 22 |
+
|
| 23 |
+
# An English description of the tensor manipulation.
|
| 24 |
+
description = 'add two vectors with broadcasting to get a matrix'
|
| 25 |
+
|
| 26 |
+
return inputs, output, constants, description
|
| 27 |
|
| 28 |
settings = settings_module.from_dict({
|
| 29 |
'timeout': 300,
|
|
|
|
| 32 |
'require_all_inputs_used': True,
|
| 33 |
'require_one_input_used': False,
|
| 34 |
})
|
| 35 |
+
inputs, output, constants, description = get_problem()
|
| 36 |
st.write(colab_interface.run_value_search_from_colab(inputs, output, constants, description, settings))
|