Unverified Commit eb2fb253 authored by Prabhat Roy's avatar Prabhat Roy Committed by GitHub
Browse files

Replaced example usage of ToTensor() by PILToTensor() + ConvertImageDtype() (#4494)

parent 7ea38b32
...@@ -35,7 +35,8 @@ class Compose: ...@@ -35,7 +35,8 @@ class Compose:
Example: Example:
>>> transforms.Compose([ >>> transforms.Compose([
>>> transforms.CenterCrop(10), >>> transforms.CenterCrop(10),
>>> transforms.ToTensor(), >>> transforms.PILToTensor(),
>>> transforms.ConvertImageDtype(torch.float),
>>> ]) >>> ])
.. note:: .. note::
...@@ -1570,7 +1571,8 @@ class RandomErasing(torch.nn.Module): ...@@ -1570,7 +1571,8 @@ class RandomErasing(torch.nn.Module):
Example: Example:
>>> transform = transforms.Compose([ >>> transform = transforms.Compose([
>>> transforms.RandomHorizontalFlip(), >>> transforms.RandomHorizontalFlip(),
>>> transforms.ToTensor(), >>> transforms.PILToTensor(),
>>> transforms.ConvertImageDtype(torch.float),
>>> transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)), >>> transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)),
>>> transforms.RandomErasing(), >>> transforms.RandomErasing(),
>>> ]) >>> ])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment