Class: TorchVision::Transforms::Normalize

Inherits:
Torch::NN::Module
  • Object
show all
Defined in:
lib/torchvision/transforms/normalize.rb

Instance Method Summary collapse

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