class_docstr: Hook used to trigger the profiling features of VISSL
docstr: Returns whether or not the profiler hook should be instantiated:
  it should be enabled if any of the profiling options is on
code: def is_enabled(profiling_config: AttrDict):
      """
      Returns whether or not the profiler hook should be instantiated:
      it should be enabled if any of the profiling options is on
      """
      with_runtime_profiling = (
          profiling_config.RUNTIME_PROFILING.USE_PROFILER
          and (
              profiling_config.RUNTIME_PROFILING.PROFILE_CPU
              or profiling_config.RUNTIME_PROFILING.PROFILE_GPU
          )
      )
      return (
          profiling_config.MEMORY_PROFILING.TRACK_BY_LAYER_MEMORY
          or with_runtime_profiling
      )
  
imports: import logging
  import os
  import torch
  import torch.nn
  from classy_vision import tasks
  from classy_vision.hooks.classy_hook import ClassyHook
  from fairscale.nn import FullyShardedDataParallel
  from fairscale.nn.misc import FlattenParamsWrapper
  from torch.nn import SyncBatchNorm
  from vissl.config.attr_dict import AttrDict
  from vissl.utils.env import get_machine_local_and_dist_rank
  from vissl.utils.layer_memory_tracking import LayerwiseMemoryTracker
  from vissl.utils.profiler import create_runtime_profiler
label_desc: Use image node_id 1 for calling the ProfilingHook obj's underlying member method code with example usage: obj.is_enabled(profiling_config) and returns: unknown