code: def make_tsv_for_relation_types(
      model: MultiRelationEmbedder,
      relation_type_storage: AbstractRelationTypeStorage,
      relation_types_tf: TextIO,
  ) -> None:
      print("Writing relation type parameters...")
      relation_types = relation_type_storage.load_names()
      if model.num_dynamic_rels > 0:
          (rel_t_config,) = model.relations
          op_name = rel_t_config.operator
          (lhs_operator,) = model.lhs_operators
          (rhs_operator,) = model.rhs_operators
          for side, operator in [
              ("lhs", lhs_operator),
              ("rhs", rhs_operator),
          ]:
              for param_name, all_params in operator.named_parameters():
                  for rel_t_name, param in zip(
                      relation_types, all_params
                  ):
                      shape = "x".join(f"{d}" for d in param.shape)
                      write(
                          relation_types_tf,
                          (
                              rel_t_name,
                              side,
                              op_name,
                              param_name,
                              shape,
                          ),
                          param.flatten(),
                      )
      else:
          for rel_t_name, rel_t_config, operator in zip(
              relation_types, model.relations, model.rhs_operators
          ):
              if rel_t_name != rel_t_config.name:
                  raise ValueError(
                      f"Mismatch in relations names: got {rel_t_name} in the "
                      f"dictionary and {rel_t_config.name} in the config."
                  )
              op_name = rel_t_config.operator
              for param_name, param in operator.named_parameters():
                  shape = "x".join(f"{d}" for d in param.shape)
                  write(
                      relation_types_tf,
                      (rel_t_name, "rhs", op_name, param_name, shape),
                      param.flatten(),
                  )
  
      relation_types_output_filename = getattr(
          relation_types_tf, "name", "the output file"
      )
      print(
          f"Done exporting relation type data to {relation_types_output_filename}"
      )
  
file_path: PyTorch-BigGraph/torchbiggraph/converters/export_to_tsv.py
imports: import argparse
  from typing import Iterable, TextIO
  from torchbiggraph.checkpoint_manager import CheckpointManager
  from torchbiggraph.config import ConfigFileLoader, ConfigSchema
  from torchbiggraph.graph_storages import AbstractEntityStorage, AbstractRelationTypeStorage, ENTITY_STORAGES, RELATION_TYPE_STORAGES
  from torchbiggraph.model import make_model, MultiRelationEmbedder
label_desc: Use image node_id 4 for calling a global function with example usage: make_tsv_for_relation_types(model, relation_type_storage, relation_types_tf) without return types