code: def __init__(
      self,
      lhs: EntityList,
      rhs: EntityList,
      rel: LongTensorType,
      weight: Optional[FloatTensorType] = None,
  ) -> None:
      if not isinstance(lhs, EntityList) or not isinstance(
          rhs, EntityList
      ):
          raise TypeError(
              "Expected left- and right-hand side to be entity lists, got "
              "%s and %s instead" % (type(lhs), type(rhs))
          )
      if not isinstance(rel, (torch.LongTensor, torch.cuda.LongTensor)):
          raise TypeError(
              "Expected relation to be a long tensor, got %s"
              % type(rel)
          )
      if len(lhs) != len(rhs):
          raise ValueError(
              "The left- and right-hand side entity lists have different "
              "lengths: %d != %d" % (len(lhs), len(rhs))
          )
      if rel.dim() > 1:
          raise ValueError(
              "The relation can be either a scalar or a 1-dimensional "
              "tensor, got a %d-dimensional tensor" % rel.dim()
          )
      if rel.dim() == 1 and rel.shape[0] != len(lhs):
          raise ValueError(
              "The relation has a different length than the entity lists: "
              "%d != %d" % (rel.shape[0], len(lhs))
          )
  
      if weight is not None and (weight.nelement() == 0):
          weight = None
  
      if weight is not None:
          if weight.dim() > 1:
              raise ValueError(
                  "The weight can be either a scalar or a 1-dimensional "
                  "tensor, got a %d-dimensional tensor" % weight.dim()
              )
          if weight.dim() == 1 and weight.shape[0] != len(lhs):
              raise ValueError(
                  "The weight has a different length than the entity lists: "
                  "%d != %d" % (weight.shape[0], len(lhs))
              )
  
      self.lhs = lhs
      self.rhs = rhs
      self.rel = rel
      self.weight = weight
  
file_path: PyTorch-BigGraph/torchbiggraph/edgelist.py
imports: from typing import Any, Optional, Sequence, Union
  import torch
  from torchbiggraph.entitylist import EntityList
  from torchbiggraph.types import FloatTensorType, LongTensorType
label_desc: Use image node_id 3 to create a new EdgeList object  with example: obj = EdgeList(lhs, rhs, rel, weight)