pytorch——常见的Transforms
transforms相当于一个工具箱,里面的类(class)totensor、resize等相当于工具。图片经过工具的处理,就会得到我们想要的结果。首先我们查看transforms的源代码中的totensor函数:class ToTensor: """Convert a ``PIL Image`` or ``numpy.ndarray`` to tensor. This transform does not support torchscript.def __