Skip to content

Commit e5e1627

Browse files
authoredDec 8, 2019
Update neurovec.py
1 parent 560b9d9 commit e5e1627

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎envs/neurovec.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def __init__(self, env_config):
3636
self.vec_action_meaning = [1,2,4,8,16,32,64] # TODO: change this to match your hardware
3737
self.interleave_action_meaning=[1,2,4,8,16] # TODO: change this to match your hardware
3838
self.action_space = spaces.Tuple([spaces.Discrete(len(self.vec_action_meaning)),spaces.Discrete(len(self.interleave_action_meaning))])
39-
#TODO you might need to next line based on the size of your C code, max sure to replace 10000.0 with the highest value the parser generates
4039

4140
self.testfiles = [os.path.join(root, name)
4241
for root, dirs, files in os.walk(self.new_rundir)
@@ -51,7 +50,7 @@ def __init__(self, env_config):
5150
self.obs_len = 384 # TODO: change obs_len based on your seting in code2vec or other code embedding
5251
self.observation_space = spaces.Box(-1.0,1.0,shape=(self.obs_len,),dtype = np.float32)
5352
self.obs_encodings = c_code2vec_get_encodings(self.new_rundir,self.const_orig_codes,self.loops_idxs_in_orig)# TODO:change this to other code embedding if necessary
54-
# this hsould be removed in later versions
53+
# this should be removed in later versions
5554
self.vec_action_meaning = [1,2,4,8,16] # TODO: change this to match your hardware
5655
self.interleave_action_meaning=[1,2,4,8] # TODO: change this to match your hardware
5756
self.action_space = spaces.Tuple([spaces.Discrete(len(self.vec_action_meaning)),spaces.Discrete(len(self.interleave_action_meaning))])
@@ -62,6 +61,7 @@ def __init__(self, env_config):
6261
self.config = Config(set_defaults=True, load_from_args=False, verify=True)
6362
self.code2vec = Code2VecModel(self.config)
6463
self.path_extractor = CExtractor(self.config,clang_path=os.environ['CLANG_PATH'],max_leaves=MAX_LEAF_NODES)
64+
#TODO: you might need to next line based on the size of your C code, max sure to replace 10000.0 with the highest value the parser generates
6565
self.observation_space = spaces.Tuple([spaces.Box(0,10000,shape=(self.config.MAX_CONTEXTS,),dtype = np.int32,)]*3+[spaces.Box(0,10000.0,shape=(self.config.MAX_CONTEXTS,),dtype = np.float32)])
6666
self.train_input_reader = self.code2vec._create_data_reader(estimator_action=EstimatorAction.Train)
6767
if self.compile:

0 commit comments

Comments
 (0)