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: Clip (in place) the boxes by limiting x coordinates to the range [0, width]
  and y coordinates to the range [0, height].
  
  Args:
      box_size (height, width): The clipping box's size.
docstr_tok: ["Clip","(","in","place",")","the","boxes","by","limiting","x","coordinates","to","the","range","[","0",",","width","]","and","y","coordinates","to","the","range","[","0",",","height","]",".","Args",":","box_size","(","height",",","width",")",":","The","clipping","box","'s","size","."]
code: def clip(self, box_size: Tuple[int, int]) -> None:
      """
      Clip (in place) the boxes by limiting x coordinates to the range [0, width]
      and y coordinates to the range [0, height].
  
      Args:
          box_size (height, width): The clipping box's size.
      """
      assert torch.isfinite(
          self.tensor
      ).all(), "Box tensor contains infinite or NaN!"
      h, w = box_size
      self.tensor[:, 0].clamp_(min=0, max=w)
      self.tensor[:, 1].clamp_(min=0, max=h)
      self.tensor[:, 2].clamp_(min=0, max=w)
      self.tensor[:, 3].clamp_(min=0, max=h)
  
imports: import math
  from enum import IntEnum, unique
  from typing import Any, List, Tuple, Union
  import numpy
  import torch
label_desc: Use image node_id 5 for calling the Boxes obj's underlying member method code with example usage: obj.clip(box_size) without return types