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.



230
231
232
# File 'lib/torch.rb', line 230

def initialize(bytes)
  @bytes = bytes
end

Instance Attribute Details

#bytesObject (readonly)

private



228
229
230
# File 'lib/torch.rb', line 228

def bytes
  @bytes
end

Class Method Details

.from_buffer(bytes) ⇒ Object



234
235
236
# File 'lib/torch.rb', line 234

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