Sha256: 5df9b7d669be137a69acd2b3c738a61e9dae855b23219a1e48e24c89c692c6e8

Contents?: true

Size: 280 Bytes

Versions: 2

Compression:

Stored size: 280 Bytes

Contents

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

      def grad
        _grad if _grad_defined
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
torch-rb-0.1.3 lib/torch/nn/parameter.rb
torch-rb-0.1.2 lib/torch/nn/parameter.rb