class TensorFlow::Data::TensorSliceDataset

Public Class Methods

new(element) click to toggle source
Calls superclass method TensorFlow::Data::Dataset::new
# File lib/tensorflow/data/tensor_slice_dataset.rb, line 4
def initialize(element)
  tensors = Utils.to_tensor_array(element)
  @tensors = tensors # keep reference for memory
  @output_types = tensors.map(&:dtype)
  @output_shapes = tensors.map { |t| t.shape[1..-1] }

  variant_tensor = RawOps.tensor_slice_dataset(components: tensors, output_shapes: @output_shapes)
  super(variant_tensor)
end