Module: RubyZero::Core::DataTypes
- Included in:
- RubyZero
- Defined in:
- lib/rubyzero/core/dtypes.rb,
lib/rubyzero/core/tensor_initialize_methods.rb
Defined Under Namespace
Classes: Boolean, Complex128, Complex64, DataType, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8
Class Method Summary collapse
-
.from_xmo_dtype(klass) ⇒ Object
convert Rubyzero datatypes from Numo/Cumo classes.
Class Method Details
.from_xmo_dtype(klass) ⇒ Object
convert Rubyzero datatypes from Numo/Cumo classes.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rubyzero/core/dtypes.rb', line 4 def self.from_xmo_dtype(klass) case klass.name when "Numo::NArray" return Float64 when "Numo::Bit" return Boolean when "Numo::Int8" return Int8 when "Numo::Int16" return Int16 when "Numo::Int32" return Int32 when "Numo::Int64" return Int64 when "Numo::UInt8" return UInt8 when "Numo::UInt16" return UInt16 when "Numo::UInt32" return UInt32 when "Numo::UInt64" return UInt64 when "Numo::SFloat" return Float32 when "Numo::DFloat" return Float64 when "Numo::SComplex" return Complex64 when "Numo::DComplex" return Complex128 end end |