GS::Tensor
Tensor: shape + strides + data buffer Immutable shape, mutable data
Constructors
arange(start : Float32, stop : Float32, step : Float32 = 1.0_f32, device : Device = Device::GPU) : Tensor
Arange
Linspace
new(shape : Shape, dtype : DType = DType::F32, device : Device = Device::GPU)
Create empty tensor on GPU
Create from shape tuple
Instance methods
buffer
Sourcecontiguous?
Sourcecpu_data
Sourcedevice
Sourcedtype
SourceAppends a String representation of this object which includes its class name, its object address and the values of all instance variables.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
ndim
Sourceon_cpu?
Sourceon_gpu?
Sourceshape
Sourcestrides
Sourceto_cpu
Sourceto_cpu!
Sourceto_flat_array
Sourceto_gpu!
Source