class_docstr: Matches patterns to apply transforms in a tf.keras model graph.
docstr: Check if specific layer matches the pattern.
code: def _match_layer(self, layer, pattern):
      """Check if specific layer matches the pattern."""
  
      if (
          self.candidate_layers
          and layer["config"]["name"] not in self.candidate_layers
      ):
          return False
  
      if not self._match_pattern(
          layer["class_name"], pattern.class_name
      ):
          return False
  
      layer_config = layer["config"]
      for key, value in pattern.config.items():
          # Either the provided value should equal the config value, or
          # be a regex match to str(value).
          if not (
              self._match_pattern(
                  str(layer_config.get(key)), str(value)
              )
              or layer_config.get(key) == value
          ):
              return False
  
      return True
  
imports: import collections
  import copy
  import re
  import tensorflow
  from tensorflow_model_optimization.python.core.quantization.keras.graph_transformations import transforms
label_desc: Use image node_id 13 for calling the ModelTransformer obj's underlying member method code with example usage: obj._match_layer(layer, pattern) and returns: True, False, False, False