MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / has_nvfuser_instance_norm

Function has_nvfuser_instance_norm

monai/networks/utils.py:96–113  ·  view source on GitHub ↗

whether the current environment has InstanceNorm3dNVFuser https://github.com/NVIDIA/apex/blob/23.05-devel/apex/normalization/instance_norm.py#L15-L16

()

Source from the content-addressed store, hash-verified

94
95
96def has_nvfuser_instance_norm():
97 """whether the current environment has InstanceNorm3dNVFuser
98 https://github.com/NVIDIA/apex/blob/23.05-devel/apex/normalization/instance_norm.py#L15-L16
99 """
100 global _has_nvfuser
101 if _has_nvfuser is not None:
102 return _has_nvfuser
103
104 _, _has_nvfuser = optional_import("apex.normalization", name="InstanceNorm3dNVFuser")
105 if not _has_nvfuser:
106 return False
107 try:
108 import importlib
109
110 importlib.import_module("instance_norm_nvfuser_cuda")
111 except ImportError:
112 _has_nvfuser = False
113 return _has_nvfuser
114
115
116def look_up_named_module(name: str, mod, print_all_options=False):

Callers 1

instance_nvfuser_factoryFunction · 0.90

Calls 1

optional_importFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…