class_docstr: Classifier based on BERT implementation.
docstr: Parse layer definitions from the input.
docstr_tok: ["Parse","layer","definitions","from","the","input","."]
code: def _get_layer_parameters(self, prev_dimension, output_dimension):
      """
      Parse layer definitions from the input.
      """
      layers = []
      dimensions = []
      no_dimension = -1
      for layer in self.classifier_layers:
          if "," in layer:
              l, d = layer.split(",")
              layers.append(l)
              dimensions.append((prev_dimension, int(d)))
              prev_dimension = int(d)
          else:
              layers.append(layer)
              dimensions.append(no_dimension)
      ind = 0
      while (
          ind < len(dimensions)
          and dimensions[len(dimensions) - ind - 1] == no_dimension
      ):
          ind += 1
      if (
          ind == len(dimensions) and prev_dimension == output_dimension
      ) or (
          ind < len(dimensions)
          and dimensions[ind][1] == output_dimension
      ):
          return layers, dimensions
  
      if ind < len(dimensions):
          raise Exception(
              f"Output layer's dimension does not match number of classes. Found {dimensions[ind][1]}, expected {output_dimension}"
          )
      raise Exception(
          f"Output layer's dimension does not match number of classes. Found {prev_dimension}, expected {output_dimension}"
      )
  
imports: import os
  from collections import deque
  from typing import Optional
  import torch
  from parlai.agents.bert_ranker.bert_dictionary import BertDictionaryAgent
  from parlai.agents.bert_ranker.helpers import BertWrapper, MODEL_PATH
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.torch_agent import History
  from parlai.core.torch_classifier_agent import TorchClassifierAgent
  from parlai.utils.io import PathManager
  from parlai.utils.misc import warn_once
  from parlai.zoo.bert.build import download
label_desc: Use image node_id 6 for calling the BertClassifierAgent obj's underlying member method code with example usage: obj._get_layer_parameters(prev_dimension, output_dimension) and returns: layers,  dimensions