class_docstr: Used as a base class for hyperparameter structs. They also need to be annotated with @dataclass.
class_docstr_tok: ["Used","as","a","base","class","for","hyperparameter","structs",".","They","also","need","to","be","annotated","with","@","dataclass","."]
code: def validate(self, *, prefix=""):
      assert is_dataclass(
          self
      ), f"You forgot to annotate {type(self)} with @dataclass"
      for f in fields(self):
          fieldval = getattr(self, f.name)
          check_type(prefix + f.name, fieldval, f.type)
          if isinstance(fieldval, HParams):
              fieldval.validate(prefix=prefix + f.name + ".")
  
imports: import typing
  from dataclasses import fields, is_dataclass
  from functools import lru_cache
  from typeguard import check_type
label_desc: Use image node_id 8 for calling the HParams obj's underlying member method code with example usage: obj.validate() without return types