class_docstr: Base class for Datasets.
docstr: Initializes the ``fields`` dict of a Dataset subclass using
  the declared ``Attributes`` and their type annotations.
docstr_tok: ["Initializes","the","``","fields","``","dict","of","a","Dataset","subclass","using","the","declared","``","Attributes","``","and","their","type","annotations","."]
code: def __init_subclass__(
      cls,
      *,
      data_name: Optional[str] = None,
      identifiers: Optional[Tuple[str, ...]] = None,
  ) -> None:
      """Initializes the ``fields`` dict of a Dataset subclass using
      the declared ``Attributes`` and their type annotations."""
  
      super().__init_subclass__()
  
      fields = {}
      if data_name:
          cls.__data_name__ = data_name
      if identifiers:
          cls.__identifiers__ = identifiers
  
      # get field info from annotated class attributes, e.g:
      # name: int = field(...)
      for name, annotated_type in cls.__annotations__.items():
          if get_origin(annotated_type) is ClassVar:
              continue
  
          try:
              field_ = getattr(cls, name)
              delattr(cls, name)
          except AttributeError:
              # field only has type annotation
              field_ = field()
  
          if field_ is _InitArg:
              continue
  
          field_.info.py_type = annotated_type
          if field_.attribute_type is UNSET:
              field_.attribute_type = match_obj_type(annotated_type)
  
          fields[name] = field_
  
      cls.fields = MappingProxyType(fields)
  
imports: import typing
  from dataclasses import dataclass
  from pathlib import Path
  from types import MappingProxyType
  from typing import Any, ClassVar, Generic, List, Literal, Optional, Tuple, Type, TypeVar, Union, cast, get_origin
  from typing_extensions import dataclass_transform
  from pennylane.data.base import hdf5
  from pennylane.data.base.attribute import AttributeInfo, DatasetAttribute
  from pennylane.data.base.hdf5 import HDF5Any, HDF5Group, h5py
  from pennylane.data.base.mapper import MapperMixin, match_obj_type
  from pennylane.data.base.typing_util import UNSET, T
label_desc: Use image node_id 18 for calling the Dataset obj's underlying member method code with example usage: obj.__init_subclass__(cls) without return types