Sha256: 68347c7282f8304192529c51649d530026bf2e9b6054a6d6ab66a91182c7dc86
Contents?: true
Size: 673 Bytes
Versions: 11
Compression:
Stored size: 673 Bytes
Contents
module Torch module Utils module Data module DataPipes module Iter class IterableWrapper < IterDataPipe def initialize(iterable, deepcopy: true) @iterable = iterable @deepcopy = deepcopy end def each source_data = @iterable if @deepcopy source_data = Marshal.load(Marshal.dump(@iterable)) end source_data.each do |data| yield data end end def length @iterable.length end end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems