Class: Torch::NN::Parameter
Constant Summary
Constants included
from Inspector
Inspector::PRINT_OPTS
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Tensor
#<=>, #[], #[]=, #cpu, #cuda, #dtype, #each, #imag, #item, #layout, #length, #new, #numo, #random!, #real, #requires_grad=, #size, #stft, #stride, #to, #to_a, #to_f, #to_i, #to_s, #type
Class Method Details
.new(data = nil, requires_grad: true) ⇒ Object
4
5
6
7
|
# File 'lib/torch/nn/parameter.rb', line 4
def self.new(data = nil, requires_grad: true)
data = Tensor.new unless data
_make_subclass(data, requires_grad)
end
|
Instance Method Details
#dup ⇒ Object
13
14
15
16
17
|
# File 'lib/torch/nn/parameter.rb', line 13
def dup
Torch.no_grad do
Parameter.new(clone, requires_grad: requires_grad)
end
end
|
#inspect ⇒ Object
9
10
11
|
# File 'lib/torch/nn/parameter.rb', line 9
def inspect
"Parameter containing:\n#{super}"
end
|