class_docstr: distributed nphi (n_topics by n_words), transpose to/from graph nodes data
class_docstr_tok: ["distributed","nphi","(","n_topics","by","n_words",")",",","transpose","to\/from","graph","nodes","data"]
code: def prepare_graph(self, G, key="Elog"):
      if "_ID" in G.nodes["word"].data:
          _ID = G.nodes["word"].data["_ID"]
      else:
          _ID = slice(None)
  
      out = [
          getattr(part, "_" + key)(_ID).to(G.device) for part in self
      ]
      G.nodes["word"].data[key] = torch.cat(out).T
  
imports: import collections
  import functools
  import io
  import os
  import warnings
  import dgl
  import numpy
  import scipy
  import torch
label_desc: Use image node_id 1 for calling the WordData obj's underlying member method code with example usage: obj.prepare_graph(G, key) without return types