Class: Torch::ByteStorage

Inherits:
Object
  • Object
show all
Defined in:
lib/torch.rb

Overview

TODO move to C++

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bytes) ⇒ ByteStorage

Returns a new instance of ByteStorage.



221
222
223
# File 'lib/torch.rb', line 221

def initialize(bytes)
  @bytes = bytes
end

Instance Attribute Details

#bytesObject (readonly)

private



219
220
221
# File 'lib/torch.rb', line 219

def bytes
  @bytes
end

Class Method Details

.from_buffer(bytes) ⇒ Object



225
226
227
# File 'lib/torch.rb', line 225

def self.from_buffer(bytes)
  new(bytes)
end