Class: Cohere::Transcribe::Safetensors::Tensor

Inherits:
Data
  • Object
show all
Defined in:
lib/cohere/transcribe/safetensors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#data_startObject (readonly)

Returns the value of attribute data_start

Returns:

  • (Object)

    the current value of data_start



24
25
26
# File 'lib/cohere/transcribe/safetensors.rb', line 24

def data_start
  @data_start
end

#dtypeObject (readonly)

Returns the value of attribute dtype

Returns:

  • (Object)

    the current value of dtype



24
25
26
# File 'lib/cohere/transcribe/safetensors.rb', line 24

def dtype
  @dtype
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



24
25
26
# File 'lib/cohere/transcribe/safetensors.rb', line 24

def name
  @name
end

#nbytesObject (readonly)

Returns the value of attribute nbytes

Returns:

  • (Object)

    the current value of nbytes



24
25
26
# File 'lib/cohere/transcribe/safetensors.rb', line 24

def nbytes
  @nbytes
end

#readerObject (readonly)

Returns the value of attribute reader

Returns:

  • (Object)

    the current value of reader



24
25
26
# File 'lib/cohere/transcribe/safetensors.rb', line 24

def reader
  @reader
end

#shapeObject (readonly)

Returns the value of attribute shape

Returns:

  • (Object)

    the current value of shape



24
25
26
# File 'lib/cohere/transcribe/safetensors.rb', line 24

def shape
  @shape
end

Instance Method Details

#element_countObject



25
26
27
# File 'lib/cohere/transcribe/safetensors.rb', line 25

def element_count
  shape.empty? ? 1 : shape.reduce(1, :*)
end

#floating_point?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/cohere/transcribe/safetensors.rb', line 29

def floating_point?
  FLOAT_DTYPES.include?(dtype)
end