MCPcopy
hub / github.com/QData/TextAttack / pytorch_multiprocessing_workaround

Function pytorch_multiprocessing_workaround

textattack/attacker.py:517–523  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

515# Helper Methods for multiprocess attacks
516#
517def pytorch_multiprocessing_workaround():
518 # This is a fix for a known bug
519 try:
520 torch.multiprocessing.set_start_method("spawn", force=True)
521 torch.multiprocessing.set_sharing_strategy("file_system")
522 except RuntimeError:
523 pass
524
525
526def set_env_variables(gpu_id):

Callers 1

_attack_parallelMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected