(images)
return images
Given a tensor of (megengine BGR) images, uses the torchvision
    normalization method to convert floating point data to integers. See reference
    at: https://pytorch.org/docs/stable/_modules/torchvision/utils.html#save_image

    The function uses the normalization from make_grid and save_image functions.

    Args:
        images (Tensor): Batch of images of shape (N, 3, H, W).

    Returns:
        ndarray: Batch of normalized (0-255) RGB images of shape (N, H, W, 3).
Given a tensor of (megengine BGR) images, uses the torchvision
    normalization method to convert floating point data to integers. See reference
    at: https://pytorch.org/docs/stable/_modules/torchvision/utils.html#save_image
Given a tensor of ( megengine BGR ) images uses the torchvision normalization method to convert floating point data to integers . See reference at : https : // pytorch . org / docs / stable / _modules / torchvision / utils . html#save_image
def _normalize_images(images):
    """
    Given a tensor of (megengine BGR) images, uses the torchvision
    normalization method to convert floating point data to integers. See reference
    at: https://pytorch.org/docs/stable/_modules/torchvision/utils.html#save_image

    The function uses the normalization from make_grid and save_image functions.

    Args:
        images (Tensor): Batch of images of shape (N, 3, H, W).

    Returns:
        ndarray: Batch of normalized (0-255) RGB images of shape (N, H, W, 3).
    """
    # Shift the image from [-1, 1] range to [0, 1] range.
    min_val = float(images.min())
    max_val = float(images.max())

    images = (images - min_val) / (max_val - min_val + 1e-5)

    images = np.clip(images * 255 + 0.5, 0, 255).astype("uint8")

    images = np.transpose(images, [0, 2, 3, 1])

    # NOTE: megengine(opencv) uses BGR, while TF uses RGB. Needs conversion.
    images = images[:, :, :, ::-1]

    return images
def _normalize_images ( images ) : # Shift the image from [-1, 1] range to [0, 1] range. min_val = float ( images . min ( ) ) max_val = float ( images . max ( ) ) images = ( images - min_val ) / ( max_val - min_val + 1e-5 ) images = np . clip ( images * 255 + 0.5 , 0 , 255 ) . astype ( "uint8" ) images = np . transpose ( images , [ 0 , 2 , 3 , 1 ] ) # NOTE: megengine(opencv) uses BGR, while TF uses RGB. Needs conversion. images = images [ : , : , : , : : - 1 ] return images