Set TF_FORCE_GPU_ALLOW_GROWTH for multi process tests
Otherwise GPU tests may OOM since TF graps the whole GPUs by default. PiperOrigin-RevId: 316152876 Change-Id: I401aeac1d42e0585b6c6deaa6de4f779e412a020
This commit is contained in:
parent
2bc49eade6
commit
5ec77d721d
|
@ -19,6 +19,7 @@ from __future__ import division
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import multiprocessing as _multiprocessing
|
import multiprocessing as _multiprocessing
|
||||||
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from tensorflow.python.platform import test
|
from tensorflow.python.platform import test
|
||||||
|
@ -42,6 +43,7 @@ class Process(object):
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
"""Main function to be called within `__main__` of a test file."""
|
"""Main function to be called within `__main__` of a test file."""
|
||||||
|
os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'
|
||||||
test.main()
|
test.main()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue