code: def encode_jpeg(
      input: torch.Tensor, quality: int = 75
  ) -> torch.Tensor:
      """
      Takes an input tensor in CHW layout and returns a buffer with the contents
      of its corresponding JPEG file.
  
      Args:
          input (Tensor[channels, image_height, image_width])): int8 image tensor of
              ``c`` channels, where ``c`` must be 1 or 3.
          quality (int): Quality of the resulting JPEG file, it must be a number between
              1 and 100. Default: 75
  
      Returns:
          output (Tensor[1]): A one dimensional int8 tensor that contains the raw bytes of the
              JPEG file.
      """
      if not torch.jit.is_scripting() and not torch.jit.is_tracing():
          _log_api_usage_once(encode_jpeg)
      if quality < 1 or quality > 100:
          raise ValueError(
              "Image quality should be a positive number between 1 and 100"
          )
  
      output = torch.ops.image.encode_jpeg(input, quality)
      return output
  
file_path: vision/torchvision/io/image.py
imports: from enum import Enum
  from warnings import warn
  import torch
  from ..extension import _load_library
  from ..utils import _log_api_usage_once
label_desc: Use image node_id 7 for calling a global function with example usage: encode_jpeg(input, quality) and returns: output