def get_all_tensor_parents(tensor):
 parents_list = []
 parents_list.append(tensor)
 if tensor.op:
  for t in tensor.op.inputs:
   parents_list += get_tensor_parents(t)
 return list(set(parents_list))

def get_all_tensor_parents ( tensor ) : parents_list = [ ] parents_list . append ( tensor ) if tensor . op : for t in tensor . op . inputs : parents_list += get_tensor_parents ( t ) return list ( set ( parents_list ) )
get all parents tensors .