def get_tensor_parents(tensor):
 parents_list = []
 parents_list.append(tensor)
 if tensor.op:
  for t in tensor.op.inputs:
   if (not ('read:0' in t.name)):
    parents_list += get_tensor_parents(t)
 return parents_list

def get_tensor_parents ( tensor ) : parents_list = [ ] parents_list . append ( tensor ) if tensor . op : for t in tensor . op . inputs : if ( not ( 'read:0' in t . name ) ) : parents_list += get_tensor_parents ( t ) return parents_list
get all calculation and data parent tensors .