class_docstr: Base class for any neural network
class_docstr_tok: ["Base","class","for","any","neural","network"]
docstr: Freeze normalization layers in the model
  
  Args:
      opts: Command-line arguments
      model: An instance of `BaseAnyNNModel`
docstr_tok: ["Freeze","normalization","layers","in","the","model","Args",":","opts",":","Command-line","arguments","model",":","An","instance","of","`","BaseAnyNNModel","`"]
code: def freeze_norm_layers(
      cls, opts: argparse.Namespace, model: BaseAnyNNModel
  ) -> None:
      """Freeze normalization layers in the model
  
      Args:
          opts: Command-line arguments
          model: An instance of `BaseAnyNNModel`
      """
      is_maseter_node = is_master(opts)
      for m in model.modules():
          if isinstance(m, norm_layers_tuple):
              m.eval()
              m.weight.requires_grad = False
              m.bias.requires_grad = False
              m.training = False
  
      # check if layers are frozen or not
      frozen_state, count_norm = check_frozen_norm_layer(model)
      if count_norm > 0 and frozen_state and is_maseter_node:
          logger.error(
              "Something is wrong while freezing normalization layers. Please check"
          )
  
      if is_maseter_node:
          logger.log("Normalization layers are frozen")
  
imports: from __future__ import annotations
  import argparse
  import traceback
  from typing import Any, Dict, List, Mapping, Optional, Tuple
  import torch
  from torch import nn
  from cvnets.layers import norm_layers_tuple
  from cvnets.misc.common import get_tensor_sizes, parameter_list
  from cvnets.misc.init_utils import initialize_weights
  from options.parse_args import JsonValidator
  from utils import logger
  from utils.common_utils import check_frozen_norm_layer
  from utils.ddp_utils import is_master
label_desc: Use image node_id 9 for calling the BaseAnyNNModel obj's underlying member method code with example usage: obj.freeze_norm_layers(cls, opts, model) without return types