class_docstr: This structure stores a list of boxes as a Nx4 torch.Tensor.
  It supports some common methods about boxes
  (`area`, `clip`, `nonempty`, etc),
  and also behaves like a Tensor
  (support indexing, `to(device)`, `.device`, and iteration over all boxes)
  
  Attributes:
      tensor (torch.Tensor): float matrix of Nx4. Each row is (x1, y1, x2, y2).
class_docstr_tok: ["This","structure","stores","a","list","of","boxes","as","a","Nx4","torch.Tensor",".","It","supports","some","common","methods","about","boxes","(","`","area","`",",","`","clip","`",",","`","nonempty","`",",","etc",")",",","and","also","behaves","like","a","Tensor","(","support","indexing",",","`","to","(","device",")","`",",","`",".device","`",",","and","iteration","over","all","boxes",")","Attributes",":","tensor","(","torch.Tensor",")",":","float","matrix","of","Nx4",".","Each","row","is","(","x1",",","y1",",","x2",",","y2",")","."]
docstr: Args:
      tensor (Tensor[float]): a Nx4 matrix.  Each row is (x1, y1, x2, y2).
docstr_tok: ["Args",":","tensor","(","Tensor","[","float","]",")",":","a","Nx4","matrix",".","Each","row","is","(","x1",",","y1",",","x2",",","y2",")","."]
code: def __init__(self, tensor: torch.Tensor):
      """
      Args:
          tensor (Tensor[float]): a Nx4 matrix.  Each row is (x1, y1, x2, y2).
      """
      if not isinstance(tensor, torch.Tensor):
          tensor = torch.as_tensor(
              tensor, dtype=torch.float32, device=torch.device("cpu")
          )
      else:
          tensor = tensor.to(torch.float32)
      if tensor.numel() == 0:
          # Use reshape, so we don't end up creating a new tensor that does not depend on
          # the inputs (and consequently confuses jit)
          tensor = tensor.reshape((-1, 4)).to(dtype=torch.float32)
      assert tensor.dim() == 2 and tensor.size(-1) == 4, tensor.size()
  
      self.tensor = tensor
  
imports: import math
  import numpy
  from enum import IntEnum, unique
  from typing import List, Tuple, Union
  import torch
  from torch import device
label_desc: Use image node_id 1 to create a new Boxes object  with example: obj = Boxes(tensor)