Module: Transformers::TorchUtils

Defined in:
lib/transformers/torch_utils.rb

Class Method Summary collapse

Class Method Details

.apply_chunking_to_forward(forward_fn, chunk_size, chunk_dim, *input_tensors) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/transformers/torch_utils.rb', line 17

def self.apply_chunking_to_forward(forward_fn, chunk_size, chunk_dim, *input_tensors)
  if chunk_size > 0
    raise Todo
  end

  forward_fn.(*input_tensors)
end