Sha256: 0e7ef41cc469109061c1629a24437157156ec69a986657252e0934f61ba353d0

Contents?: true

Size: 396 Bytes

Versions: 30

Compression:

Stored size: 396 Bytes

Contents

module Torch
  module NN
    module Utils
      def _single(value)
        _ntuple(1, value)
      end

      def _pair(value)
        _ntuple(2, value)
      end

      def _triple(value)
        _ntuple(3, value)
      end

      def _quadrupal(value)
        _ntuple(4, value)
      end

      def _ntuple(n, value)
        value.is_a?(Array) ? value : [value] * n
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
torch-rb-0.8.1 lib/torch/nn/utils.rb
torch-rb-0.8.0 lib/torch/nn/utils.rb
torch-rb-0.7.0 lib/torch/nn/utils.rb
torch-rb-0.6.0 lib/torch/nn/utils.rb
torch-rb-0.5.3 lib/torch/nn/utils.rb
torch-rb-0.5.2 lib/torch/nn/utils.rb
torch-rb-0.5.1 lib/torch/nn/utils.rb
torch-rb-0.5.0 lib/torch/nn/utils.rb
torch-rb-0.4.2 lib/torch/nn/utils.rb
torch-rb-0.4.1 lib/torch/nn/utils.rb
torch-rb-0.4.0 lib/torch/nn/utils.rb
torch-rb-0.3.7 lib/torch/nn/utils.rb
torch-rb-0.3.6 lib/torch/nn/utils.rb
torch-rb-0.3.5 lib/torch/nn/utils.rb
torch-rb-0.3.4 lib/torch/nn/utils.rb
torch-rb-0.3.3 lib/torch/nn/utils.rb
torch-rb-0.3.2 lib/torch/nn/utils.rb
torch-rb-0.3.1 lib/torch/nn/utils.rb
torch-rb-0.3.0 lib/torch/nn/utils.rb
torch-rb-0.2.7 lib/torch/nn/utils.rb