File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 99"""Custom PyTorch ops for efficient bias and activation."""
1010
1111import os
12- import sys
1312import warnings
1413import numpy as np
1514import torch
1615import dnnlib
16+ import traceback
1717
1818from .. import custom_ops
1919from .. import misc
@@ -47,7 +47,7 @@ def _init():
4747 try :
4848 _plugin = custom_ops .get_plugin ('bias_act_plugin' , sources = sources , extra_cuda_cflags = ['--use_fast_math' ])
4949 except :
50- warnings .warn ('Failed to build CUDA kernels for bias_act. Falling back to slow reference implementation. Details:\n \n ' + str ( sys . exc_info ()[ 1 ] ))
50+ warnings .warn ('Failed to build CUDA kernels for bias_act. Falling back to slow reference implementation. Details:\n \n ' + traceback . format_exc ( ))
5151 return _plugin is not None
5252
5353#----------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ def _should_use_custom_op(input):
5050 return False
5151 if input .device .type != 'cuda' :
5252 return False
53- if any (torch .__version__ .startswith (x ) for x in ['1.7.' , '1.8.' ]):
53+ if any (torch .__version__ .startswith (x ) for x in ['1.7.' , '1.8.' , '1.9' ]):
5454 return True
5555 warnings .warn (f'conv2d_gradfix not supported on PyTorch { torch .__version__ } . Falling back to torch.nn.functional.conv2d().' )
5656 return False
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def grid_sample(input, grid):
3434def _should_use_custom_op ():
3535 if not enabled :
3636 return False
37- if any (torch .__version__ .startswith (x ) for x in ['1.7.' , '1.8.' ]):
37+ if any (torch .__version__ .startswith (x ) for x in ['1.7.' , '1.8.' , '1.9' ]):
3838 return True
3939 warnings .warn (f'grid_sample_gradfix not supported on PyTorch { torch .__version__ } . Falling back to torch.nn.functional.grid_sample().' )
4040 return False
Original file line number Diff line number Diff line change 99"""Custom PyTorch ops for efficient resampling of 2D images."""
1010
1111import os
12- import sys
1312import warnings
1413import numpy as np
1514import torch
15+ import traceback
1616
1717from .. import custom_ops
1818from .. import misc
@@ -31,7 +31,7 @@ def _init():
3131 try :
3232 _plugin = custom_ops .get_plugin ('upfirdn2d_plugin' , sources = sources , extra_cuda_cflags = ['--use_fast_math' ])
3333 except :
34- warnings .warn ('Failed to build CUDA kernels for upfirdn2d. Falling back to slow reference implementation. Details:\n \n ' + str ( sys . exc_info ()[ 1 ] ))
34+ warnings .warn ('Failed to build CUDA kernels for upfirdn2d. Falling back to slow reference implementation. Details:\n \n ' + traceback . format_exc ( ))
3535 return _plugin is not None
3636
3737def _parse_scaling (scaling ):
You can’t perform that action at this time.
0 commit comments