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