class_docstr: A container to represent a graph. The data associated with the Graph is
  stored in its attributes:
  
      - `x`, for the node features;
      - `a`, for the adjacency matrix;
      - `e`, for the edge attributes;
      - `y`, for the node or graph labels;
  
  All of these default to `None` if you don't specify them in the constructor.
  If you want to read all non-None attributes at once, you can call the
  `numpy()` method, which will return all data in a tuple (with the order
  defined above).
  
  Graphs also have the following attributes that are computed automatically
  from the data:
  
  - `n_nodes`: number of nodes;
  - `n_edges`: number of edges;
  - `n_node_features`: size of the node features, if available;
  - `n_edge_features`: size of the edge features, if available;
  - `n_labels`: size of the labels, if available;
  
  Any additional `kwargs` passed to the constructor will be automatically
  assigned as instance attributes of the graph.
  
  Data can be stored in Numpy arrays or Scipy sparse matrices, and labels can
  also be scalars.
  
  Spektral usually assumes that the different data matrices have specific
  shapes, although this is not strictly enforced to allow more flexibility.
  In general, node attributes should have shape `(n_nodes, n_node_features)` and the adjacency
  matrix should have shape `(n_nodes, n_nodes)`.
  
  Edge attributes can be stored in a dense format as arrays of shape
  `(n_nodes, n_nodes, n_edge_features)` or in a sparse format as arrays of shape `(n_edges, n_edge_features)`
  (so that you don't have to store all the zeros for missing edges). Most
  components of Spektral will know how to deal with both situations
  automatically.
  
  Labels can refer to the entire graph (shape `(n_labels, )`) or to each
  individual node (shape `(n_nodes, n_labels)`).
  
  **Arguments**
  
  - `x`: np.array, the node features (shape `(n_nodes, n_node_features)`);
  - `a`: np.array or scipy.sparse matrix, the adjacency matrix (shape `(n_nodes, n_nodes)`);
  - `e`: np.array, the edge features (shape `(n_nodes, n_nodes, n_edge_features)` or `(n_edges, n_edge_features)`);
  - `y`: np.array, the node or graph labels (shape `(n_nodes, n_labels)` or `(n_labels, )`);
class_docstr_tok: ["A","container","to","represent","a","graph",".","The","data","associated","with","the","Graph","is","stored","in","its","attributes",":","-","`","x","`",",","for","the","node","features",";","-","`","a","`",",","for","the","adjacency","matrix",";","-","`","e","`",",","for","the","edge","attributes",";","-","`","y","`",",","for","the","node","or","graph","labels",";","All","of","these","default","to","`","None","`","if","you","do","n't","specify","them","in","the","constructor",".","If","you","want","to","read","all","non-None","attributes","at","once",",","you","can","call","the","`","numpy","(",")","`","method",",","which","will","return","all","data","in","a","tuple","(","with","the","order","defined","above",")",".","Graphs","also","have","the","following","attributes","that","are","computed","automatically","from","the","data",":","-","`","n_nodes","`",":","number","of","nodes",";","-","`","n_edges","`",":","number","of","edges",";","-","`","n_node_features","`",":","size","of","the","node","features",",","if","available",";","-","`","n_edge_features","`",":","size","of","the","edge","features",",","if","available",";","-","`","n_labels","`",":","size","of","the","labels",",","if","available",";","Any","additional","`","kwargs","`","passed","to","the","constructor","will","be","automatically","assigned","as","instance","attributes","of","the","graph",".","Data","can","be","stored","in","Numpy","arrays","or","Scipy","sparse","matrices",",","and","labels","can","also","be","scalars",".","Spektral","usually","assumes","that","the","different","data","matrices","have","specific","shapes",",","although","this","is","not","strictly","enforced","to","allow","more","flexibility",".","In","general",",","node","attributes","should","have","shape","`","(","n_nodes",",","n_node_features",")","`","and","the","adjacency","matrix","should","have","shape","`","(","n_nodes",",","n_nodes",")","`",".","Edge","attributes","can","be","stored","in","a","dense","format","as","arrays","of","shape","`","(","n_nodes",",","n_nodes",",","n_edge_features",")","`","or","in","a","sparse","format","as","arrays","of","shape","`","(","n_edges",",","n_edge_features",")","`","(","so","that","you","do","n't","have","to","store","all","the","zeros","for","missing","edges",")",".","Most","components","of","Spektral","will","know","how","to","deal","with","both","situations","automatically",".","Labels","can","refer","to","the","entire","graph","(","shape","`","(","n_labels",",",")","`",")","or","to","each","individual","node","(","shape","`","(","n_nodes",",","n_labels",")","`",")",".","*","*","Arguments","*","*","-","`","x","`",":","np.array",",","the","node","features","(","shape","`","(","n_nodes",",","n_node_features",")","`",")",";","-","`","a","`",":","np.array","or","scipy.sparse","matrix",",","the","adjacency","matrix","(","shape","`","(","n_nodes",",","n_nodes",")","`",")",";","-","`","e","`",":","np.array",",","the","edge","features","(","shape","`","(","n_nodes",",","n_nodes",",","n_edge_features",")","`","or","`","(","n_edges",",","n_edge_features",")","`",")",";","-","`","y","`",":","np.array",",","the","node","or","graph","labels","(","shape","`","(","n_nodes",",","n_labels",")","`","or","`","(","n_labels",",",")","`",")",";"]
code: def __setitem__(self, key, value):
      setattr(self, key, value)
  
file_path: spektral/spektral/data/graph.py
imports: import warnings
  import numpy
  import scipy.sparse
label_desc: Use image node_id 4 for calling the Graph obj's underlying member method code with example usage: obj.__setitem__(key, value) without return types