Class: Torch::Distributions::Normal
- Inherits:
-
ExponentialFamily
- Object
- Distribution
- ExponentialFamily
- Torch::Distributions::Normal
- Defined in:
- lib/torch/distributions/normal.rb
Instance Method Summary collapse
-
#initialize(loc, scale, validate_args: nil) ⇒ Normal
constructor
A new instance of Normal.
- #sample(sample_shape: []) ⇒ Object
Constructor Details
#initialize(loc, scale, validate_args: nil) ⇒ Normal
Returns a new instance of Normal.
4 5 6 7 8 9 10 11 12 |
# File 'lib/torch/distributions/normal.rb', line 4 def initialize(loc, scale, validate_args: nil) @loc, @scale = Utils.broadcast_all(loc, scale) if loc.is_a?(Numeric) && scale.is_a?(Numeric) batch_shape = [] else batch_shape = @loc.size end super(batch_shape:, validate_args:) end |