Class: Cohere::Transcribe::Safetensors::Tensor
- Inherits:
-
Data
- Object
- Data
- Cohere::Transcribe::Safetensors::Tensor
- Defined in:
- lib/cohere/transcribe/safetensors.rb
Instance Attribute Summary collapse
-
#data_start ⇒ Object
readonly
Returns the value of attribute data_start.
-
#dtype ⇒ Object
readonly
Returns the value of attribute dtype.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#nbytes ⇒ Object
readonly
Returns the value of attribute nbytes.
-
#reader ⇒ Object
readonly
Returns the value of attribute reader.
-
#shape ⇒ Object
readonly
Returns the value of attribute shape.
Instance Method Summary collapse
Instance Attribute Details
#data_start ⇒ Object (readonly)
Returns the value of attribute data_start
24 25 26 |
# File 'lib/cohere/transcribe/safetensors.rb', line 24 def data_start @data_start end |
#dtype ⇒ Object (readonly)
Returns the value of attribute dtype
24 25 26 |
# File 'lib/cohere/transcribe/safetensors.rb', line 24 def dtype @dtype end |
#name ⇒ Object (readonly)
Returns the value of attribute name
24 25 26 |
# File 'lib/cohere/transcribe/safetensors.rb', line 24 def name @name end |
#nbytes ⇒ Object (readonly)
Returns the value of attribute nbytes
24 25 26 |
# File 'lib/cohere/transcribe/safetensors.rb', line 24 def nbytes @nbytes end |
#reader ⇒ Object (readonly)
Returns the value of attribute reader
24 25 26 |
# File 'lib/cohere/transcribe/safetensors.rb', line 24 def reader @reader end |
#shape ⇒ Object (readonly)
Returns the value of attribute shape
24 25 26 |
# File 'lib/cohere/transcribe/safetensors.rb', line 24 def shape @shape end |
Instance Method Details
#element_count ⇒ Object
25 26 27 |
# File 'lib/cohere/transcribe/safetensors.rb', line 25 def element_count shape.empty? ? 1 : shape.reduce(1, :*) end |
#floating_point? ⇒ Boolean
29 30 31 |
# File 'lib/cohere/transcribe/safetensors.rb', line 29 def floating_point? FLOAT_DTYPES.include?(dtype) end |