class_docstr: Feature encoder for NetworkX representations of TypeDB data. Type data is assumed always present for each node
  and edge, consistent with the TypeDB knowledge model. Therefore, this encoder provides a de-factor method to
  embed that type information. Supply attribute-specific encoders to handle encoding values of attributes,
  since the meaning of these values is domain-dependent.
class_docstr_tok: ["Feature","encoder","for","NetworkX","representations","of","TypeDB","data",".","Type","data","is","assumed","always","present","for","each","node","and","edge",",","consistent","with","the","TypeDB","knowledge","model",".","Therefore",",","this","encoder","provides","a","de-factor","method","to","embed","that","type","information",".","Supply","attribute-specific","encoders","to","handle","encoding","values","of","attributes",",","since","the","meaning","of","these","values","is","domain-dependent","."]
code: def encode_edge_features(self, graph):
      for edge_data in multidigraph_edge_data_iterator(graph):
          type_embedding = self.node_type_embedding(
              torch.as_tensor(self.edge_types.index(edge_data["type"]))
          )
          edge_data["edge_attr"] = (
              torch.hstack(
                  [
                      type_embedding,
                      torch.as_tensor(
                          [0] * self.attribute_encoding_size
                      ),
                  ]
              )
              .cpu()
              .detach()
              .numpy()
          )
  
file_path: typedb-ml/typedb_ml/pytorch_geometric/transform/encode.py
imports: from typing import List
  import torch
  from torch.nn import Embedding
  from typedb_ml.networkx.iterate import multidigraph_node_data_iterator, multidigraph_edge_data_iterator
label_desc: Use image node_id 4 for calling the FeatureEncoder obj's underlying member method code with example usage: obj.encode_edge_features(graph) without return types