class_docstr: BlockArgs object to assist in decoding string notation
      of arguments for MBConvBlock definition.
class_docstr_tok: ["BlockArgs","object","to","assist","in","decoding","string","notation","of","arguments","for","MBConvBlock","definition","."]
docstr: Get a BlockArgs object from a string notation of arguments.
  
  Args:
      block_string (str): A string notation of arguments.
                          Examples: "r1_k3_s11_e1_i32_o16_se0.25".
  
  Returns:
      BlockArgs: namedtuple defined at the top of this function.
docstr_tok: ["Get","a","BlockArgs","object","from","a","string","notation","of","arguments",".","Args",":","block_string","(","str",")",":","A","string","notation","of","arguments",".","Examples",":","``","r1_k3_s11_e1_i32_o16_se0.25","''",".","Returns",":","BlockArgs",":","namedtuple","defined","at","the","top","of","this","function","."]
code: def from_string(block_string: str):
      """
      Get a BlockArgs object from a string notation of arguments.
  
      Args:
          block_string (str): A string notation of arguments.
                              Examples: "r1_k3_s11_e1_i32_o16_se0.25".
  
      Returns:
          BlockArgs: namedtuple defined at the top of this function.
      """
      ops = block_string.split("_")
      options = {}
      for op in ops:
          splits = re.split(r"(\d.*)", op)
          if len(splits) >= 2:
              key, value = splits[:2]
              options[key] = value
  
      # check stride
      stride_check = (
          ("s" in options and len(options["s"]) == 1)
          or (
              len(options["s"]) == 2
              and options["s"][0] == options["s"][1]
          )
          or (
              len(options["s"]) == 3
              and options["s"][0] == options["s"][1]
              and options["s"][0] == options["s"][2]
          )
      )
      if not stride_check:
          raise ValueError("invalid stride option received")
  
      return BlockArgs(
          num_repeat=int(options["r"]),
          kernel_size=int(options["k"]),
          stride=int(options["s"][0]),
          expand_ratio=int(options["e"]),
          input_filters=int(options["i"]),
          output_filters=int(options["o"]),
          id_skip=("noskip" not in block_string),
          se_ratio=float(options["se"]) if "se" in options else None,
      )
  
imports: from __future__ import annotations
  import math
  import operator
  import re
  from functools import reduce
  from typing import NamedTuple
  import torch
  from torch import nn
  from torch.utils import model_zoo
  from monai.networks.blocks import BaseEncoder
  from monai.networks.layers.factories import Act, Conv, Pad, Pool
  from monai.networks.layers.utils import get_norm_layer
  from monai.utils.module import look_up_option
label_desc: Use image node_id 1 for calling the BlockArgs obj's underlying member method code with example usage: obj.from_string(block_string) and returns: BlockArgs