Sha256: 073cbd6b2d0621b8a75781fe175c0bee2f52e65d89c93d6077247c871f1b0238
Contents?: true
Size: 466 Bytes
Versions: 10
Compression:
Stored size: 466 Bytes
Contents
module Torch module Utils module Data class TensorDataset < Dataset def initialize(*tensors) unless tensors.all? { |t| t.size(0) == tensors[0].size(0) } raise Error, "Tensors must all have same dim 0 size" end @tensors = tensors end def [](index) @tensors.map { |t| t[index] } end def size @tensors[0].size(0) end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems