Sha256: 45e56ae9a5bdcdca335e42f1c479a5b4bfba7b8f9b10d17964c37661b19885b1

Contents?: true

Size: 1.61 KB

Versions: 1

Compression:

Stored size: 1.61 KB

Contents

if RUBY_PLATFORM == "wasm32-wasi"
  require "narray.so"
else
  require "numo/narray"
end

module DNN
  if ENV["RUBY_DNN_USE_CUMO"] == "ENABLE"
    require "cumo/narray"
    Xumo = ::Cumo
  else
    if defined? ::Cumo
      Xumo = ::Cumo
    else
      Xumo = ::Numo
    end
  end

  def self.use_cumo?
    defined? ::Cumo
  end

  def self.cudnn_available?
    return false unless defined? ::Cumo
    Cumo::CUDA::CUDNN.available?
  end

  def self.use_cudnn?
    return false unless ENV["RUBY_DNN_USE_CUDNN"] == "ENABLE"
    cudnn_available?
  end
end

if RUBY_PLATFORM != "wasm32-wasi"
  require_relative "dnn/version"
  require_relative "dnn/core/monkey_patch"
  require_relative "dnn/core/error"
  require_relative "dnn/core/global"
  require_relative "dnn/core/tensor"
  require_relative "dnn/core/param"
  require_relative "dnn/core/link"
  require_relative "dnn/core/iterator"
  require_relative "dnn/core/models"
  require_relative "dnn/core/layers/basic_layers"
  require_relative "dnn/core/layers/normalizations"
  require_relative "dnn/core/layers/activations"
  require_relative "dnn/core/layers/merge_layers"
  require_relative "dnn/core/layers/split_layers"
  require_relative "dnn/core/layers/cnn_layers"
  require_relative "dnn/core/layers/embedding"
  require_relative "dnn/core/layers/rnn_layers"
  require_relative "dnn/core/layers/math_layers"
  require_relative "dnn/core/optimizers"
  require_relative "dnn/core/losses"
  require_relative "dnn/core/initializers"
  require_relative "dnn/core/regularizers"
  require_relative "dnn/core/callbacks"
  require_relative "dnn/core/savers"
  require_relative "dnn/core/utils"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-dnn-1.3.0 lib/dnn.rb