Sha256: d65c66a2ac125b94794942bcb1816a91c3829700a6750785e20c147d407960d5
Contents?: true
Size: 446 Bytes
Versions: 41
Compression:
Stored size: 446 Bytes
Contents
module Torch module Utils module Data class Subset < Dataset def initialize(dataset, indices) @dataset = dataset @indices = indices end def [](idx) @dataset[@indices[idx]] end def length @indices.length end alias_method :size, :length def to_a @indices.map { |i| @dataset[i] } end end end end end
Version data entries
41 entries across 41 versions & 1 rubygems
Version | Path |
---|---|
torch-rb-0.3.2 | lib/torch/utils/data/subset.rb |