def save(obj, f, pickle_module=pickle, pickle_protocol=DEFAULT_PROTOCOL):
 new_fd = False
 if isinstance(f, str):
  new_fd = True
  f = open(f, 'wb')
 try:
  return _save(obj, f, pickle_module, pickle_protocol)
 finally:
  if new_fd:
   f.close()

def save ( obj , f , pickle_module = pickle , pickle_protocol = DEFAULT_PROTOCOL ) : new_fd = False if isinstance ( f , str ) : new_fd = True f = open ( f , 'wb' ) try : return _save ( obj , f , pickle_module , pickle_protocol ) finally : if new_fd : f . close ( )
save tensorflow model checkpoint .