Sha256: 40ee995caa034d2a990aab8e94d0e6773413d62bf93edafdb2018c23e8def73a

Contents?: true

Size: 410 Bytes

Versions: 3

Compression:

Stored size: 410 Bytes

Contents

module Torch
  module NN
    class Parameter < Tensor
      def self.new(data = nil, requires_grad: true)
        data = Tensor.new unless data
        _make_subclass(data, requires_grad)
      end

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

      def dup
        Torch.no_grad do
          Parameter.new(clone, requires_grad: requires_grad)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
torch-rb-0.9.1 lib/torch/nn/parameter.rb
torch-rb-0.9.0 lib/torch/nn/parameter.rb
torch-rb-0.8.3 lib/torch/nn/parameter.rb