3d03ae2086b232cb6803507ae4defd997c256ec9,tensorflow/python/distribute/multi_process_lib.py,,_set_spawn_exe_path,#,90

Before Change


      // and the binary is
      // /.../org_tensorflow/tensorflow/python/distribute/input_lib_test_multiworker_gpu
      org_tensorflow_path = sys.argv[0][:sys.argv[0].rfind("/tensorflow")]
      if org_tensorflow_path.endswith("/org_tensorflow"):
        binary = os.environ["TEST_TARGET"][2:].replace(":", "/", 1)
      possible_path = os.path.join(org_tensorflow_path, binary)
      logging.info("Guessed test binary path: %s", possible_path)
      if os.access(possible_path, os.X_OK):
        path = possible_path

After Change


    path_to_use = None
    guess_path = sys.argv[0][:-3]
    guess_path = guess_path.split(os.sep)
    for path_reduction in range(-1, -len(guess_path), -1):
      possible_path = os.sep.join(guess_path[:path_reduction] +
                                  [guess_path[-1]])
      if os.access(possible_path, os.X_OK):
        path_to_use = possible_path
        break
      // The binary can possibly have _gpu suffix.
      possible_path += "_gpu"
      if os.access(possible_path, os.X_OK):
        path_to_use = possible_path
        break
    if path_to_use is None:
      raise RuntimeError("Cannot determine binary path")
    sys.argv[0] = path_to_use
  // Note that this sets the executable for *all* contexts.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: tensorflow/tensorflow
Commit Name: 3d03ae2086b232cb6803507ae4defd997c256ec9
Time: 2020-11-18
Author: crccw@google.com
File Name: tensorflow/python/distribute/multi_process_lib.py
Class Name:
Method Name: _set_spawn_exe_path


Project Name: kmike/pymorphy2
Commit Name: e6203448f606be72493e30b03a7e78e8082cd1c5
Time: 2013-03-05
Author: kmike84@gmail.com
File Name: pymorphy2/units/by_hyphen.py
Class Name: HyphenSeparatedParticleAnalyzer
Method Name: tag


Project Name: pyinstaller/pyinstaller
Commit Name: d437018f0fca2b15bbdd5b380c1654d354ae5672
Time: 2012-09-13
Author: mzibr.public@gmail.com
File Name: PyInstaller/hooks/shared_PIL_Image.py
Class Name:
Method Name: hook