Class: TorchVision::Transforms::Normalize
- Inherits:
-
Torch::NN::Module
- Object
- Torch::NN::Module
- TorchVision::Transforms::Normalize
- Defined in:
- lib/torchvision/transforms/normalize.rb
Instance Method Summary collapse
- #forward(tensor) ⇒ Object
-
#initialize(mean, std, inplace: false) ⇒ Normalize
constructor
A new instance of Normalize.
Constructor Details
#initialize(mean, std, inplace: false) ⇒ Normalize
Returns a new instance of Normalize.
4 5 6 7 8 |
# File 'lib/torchvision/transforms/normalize.rb', line 4 def initialize(mean, std, inplace: false) @mean = mean @std = std @inplace = inplace end |
Instance Method Details
#forward(tensor) ⇒ Object
10 11 12 |
# File 'lib/torchvision/transforms/normalize.rb', line 10 def forward(tensor) F.normalize(tensor, @mean, @std, inplace: @inplace) end |