Class: TorchVision::Transforms::CenterCrop
- Inherits:
-
Torch::NN::Module
- Object
- Torch::NN::Module
- TorchVision::Transforms::CenterCrop
- Defined in:
- lib/torchvision/transforms/center_crop.rb
Instance Method Summary collapse
- #forward(img) ⇒ Object
-
#initialize(size) ⇒ CenterCrop
constructor
A new instance of CenterCrop.
Constructor Details
#initialize(size) ⇒ CenterCrop
Returns a new instance of CenterCrop.
4 5 6 |
# File 'lib/torchvision/transforms/center_crop.rb', line 4 def initialize(size) @size = size end |
Instance Method Details
#forward(img) ⇒ Object
8 9 10 |
# File 'lib/torchvision/transforms/center_crop.rb', line 8 def forward(img) F.center_crop(img, @size) end |