File size: 1,057 Bytes
5bd77b5
 
 
 
 
12bcda5
 
d222738
 
12bcda5
 
56035d8
 
 
12bcda5
 
d222738
12bcda5
7d34933
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import streamlit as st
import numpy as np
import tensorflow as tf
from tf_coder.value_search import colab_interface
from tf_coder.value_search import value_search_settings as settings_module

inputs = st.text_area('A dict mapping input variable names to input tensors.', placeholder='''
{'rows': [10, 20, 30],
'cols': [1, 2, 3, 4],}
    ''')
output = st.text_area('The corresponding output tensor.', placeholder='''
[[11, 12, 13, 14],
[21, 22, 23, 24],
[31, 32, 33, 34]]
    ''')
    
constants = st.text_input('A list of relevant scalar constants, if any.', placeholder='[]' )

description = st.text_input('An English natural language description of the tensor manipulation', placeholder='Add two vectors with broadcasting to get a matrix')

settings = settings_module.from_dict({
      'timeout': 300,
      'only_minimal_solutions': False,
      'max_solutions': 1,
      'require_all_inputs_used': True,
      'require_one_input_used': False,
  })
 
st.write(colab_interface.run_value_search_from_colab(inputs, output, constants, description, settings))