hflip¶ torchvision.transforms.functional.hflip(img: Tensor) → Tensor[source]¶ 水平翻转给定图像。 参数: img (PIL Image 或 Tensor) – 要翻转的图像。如果 img 是 Tensor,则期望其格式为 […, H, W],其中 … 表示它可以有任意数量的前导维度。 返回: 水平翻转后的图像。 返回类型: PIL 图像或张量 使用 hflip 的示例 转换图示 转换图示