Class: Torch::NN::Parameter

Inherits:
Tensor
  • Object
show all
Defined in:
lib/torch/nn/parameter.rb

Constant Summary

Constants included from Inspector

Inspector::PRINT_OPTS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Tensor

#%, #&, #*, #**, #+, #-, #-@, #/, #<=>, #[], #[]=, #^, #add!, #clamp!, #cpu, #cuda, #dtype, #each, #item, #layout, #length, #new, #new_ones, #numo, #random!, #requires_grad!, #reshape, #shape, #size, #to, #to_a, #to_f, #to_i, #to_s, #type, #view, #|

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
  Tensor._make_subclass(data, requires_grad)
end

Instance Method Details

#inspectObject



9
10
11
# File 'lib/torch/nn/parameter.rb', line 9

def inspect
  "Parameter containing:\n#{super}"
end