class TorchText::Datasets::TextClassificationDataset
Attributes
labels[R]
vocab[R]
Public Class Methods
new(vocab, data, labels)
click to toggle source
Calls superclass method
# File lib/torchtext/datasets/text_classification_dataset.rb, line 6 def initialize(vocab, data, labels) super() @data = data @labels = labels @vocab = vocab end
Public Instance Methods
[](i)
click to toggle source
# File lib/torchtext/datasets/text_classification_dataset.rb, line 13 def [](i) @data[i] end
each() { |x| ... }
click to toggle source
# File lib/torchtext/datasets/text_classification_dataset.rb, line 22 def each @data.each do |x| yield x end end
length()
click to toggle source
# File lib/torchtext/datasets/text_classification_dataset.rb, line 17 def length @data.length end
Also aliased as: size