class_docstr: A plain python object modeling a heterogeneous graph with various
  attributes (Node types in :class:`HeteroGraph` require string type).
  
  Args:
      G (:class:`networkx.classes.graph`): A NetworkX graph object which
          contains features and labels for each node type and edge type.
      **kwargs: Keyworded argument list with keys such
          as :obj:`"node_feature"`, :obj:`"node_label"` and
          corresponding attributes.
class_docstr_tok: ["A","plain","python","object","modeling","a","heterogeneous","graph","with","various","attributes","(","Node","types","in",":","class",":","`","HeteroGraph","`","require","string","type",")",".","Args",":","G","(",":","class",":","`","networkx.classes.graph","`",")",":","A","NetworkX","graph","object","which","contains","features","and","labels","for","each","node","type","and","edge","type",".","*","*","kwargs",":","Keyworded","argument","list","with","keys","such","as",":","obj",":","`","``","node_feature","''","`",",",":","obj",":","`","``","node_label","''","`","and","corresponding","attributes","."]
docstr: Returns the number of dimensions for one graph/node/edge property
  for specified types.
  
  Args:
      key (str): The chosen property.
      obj_type (str): Node or message type.
      as_label (bool): If `as_label`, treat the tensor as labels.
docstr_tok: ["Returns","the","number","of","dimensions","for","one","graph\/node\/edge","property","for","specified","types",".","Args",":","key","(","str",")",":","The","chosen","property",".","obj_type","(","str",")",":","Node","or","message","type",".","as_label","(","bool",")",":","If","`","as_label","`",",","treat","the","tensor","as","labels","."]
code: def get_num_dims(self, key, obj_type, as_label: bool = False) -> int:
      r"""
      Returns the number of dimensions for one graph/node/edge property
      for specified types.
  
      Args:
          key (str): The chosen property.
          obj_type (str): Node or message type.
          as_label (bool): If `as_label`, treat the tensor as labels.
      """
      if as_label:
          # treat as label
          if self[key] is not None and obj_type in self[key]:
              if self[key][obj_type].dtype == torch.long:
                  # classification label
                  return self.get_num_labels(key, obj_type).shape[0]
              else:
                  # regression label
                  if len(self[key][obj_type].shape) == 1:
                      return 1
                  else:
                      return self.edge_label[obj_type].shape[1]
          else:
              return 0
      else:
          # treat as feature
          if self[key][obj_type] is not None:
              return self[key][obj_type].shape[1]
          else:
              return 0
  
imports: import math
  import copy
  import random
  import torch
  import networkx
  import numpy
  from deepsnap.graph import Graph
  from typing import Dict, List, Union
  import warnings
label_desc: Use image node_id 24 for calling the HeteroGraph obj's underlying member method code with example usage: obj.get_num_dims(key, obj_type, as_label) and returns: int, self, int, self, int, self