Class: Cohere::Transcribe::PyTorchCheckpoint::Tensor

Inherits:
Data
  • Object
show all
Defined in:
lib/cohere/transcribe/pytorch_checkpoint.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



49
50
51
# File 'lib/cohere/transcribe/pytorch_checkpoint.rb', line 49

def data_start
  @data_start
end

#dtypeObject (readonly)

Returns the value of attribute dtype

Returns:

  • (Object)

    the current value of dtype



49
50
51
# File 'lib/cohere/transcribe/pytorch_checkpoint.rb', line 49

def dtype
  @dtype
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



49
50
51
# File 'lib/cohere/transcribe/pytorch_checkpoint.rb', line 49

def name
  @name
end

#nbytesObject (readonly)

Returns the value of attribute nbytes

Returns:

  • (Object)

    the current value of nbytes



49
50
51
# File 'lib/cohere/transcribe/pytorch_checkpoint.rb', line 49

def nbytes
  @nbytes
end

#readerObject (readonly)

Returns the value of attribute reader

Returns:

  • (Object)

    the current value of reader



49
50
51
# File 'lib/cohere/transcribe/pytorch_checkpoint.rb', line 49

def reader
  @reader
end

#shapeObject (readonly)

Returns the value of attribute shape

Returns:

  • (Object)

    the current value of shape



49
50
51
# File 'lib/cohere/transcribe/pytorch_checkpoint.rb', line 49

def shape
  @shape
end

#storage_data_startObject (readonly)

Returns the value of attribute storage_data_start

Returns:

  • (Object)

    the current value of storage_data_start



49
50
51
# File 'lib/cohere/transcribe/pytorch_checkpoint.rb', line 49

def storage_data_start
  @storage_data_start
end

#storage_elementsObject (readonly)

Returns the value of attribute storage_elements

Returns:

  • (Object)

    the current value of storage_elements



49
50
51
# File 'lib/cohere/transcribe/pytorch_checkpoint.rb', line 49

def storage_elements
  @storage_elements
end

#storage_keyObject (readonly)

Returns the value of attribute storage_key

Returns:

  • (Object)

    the current value of storage_key



49
50
51
# File 'lib/cohere/transcribe/pytorch_checkpoint.rb', line 49

def storage_key
  @storage_key
end

#storage_offsetObject (readonly)

Returns the value of attribute storage_offset

Returns:

  • (Object)

    the current value of storage_offset



49
50
51
# File 'lib/cohere/transcribe/pytorch_checkpoint.rb', line 49

def storage_offset
  @storage_offset
end

#strideObject (readonly)

Returns the value of attribute stride

Returns:

  • (Object)

    the current value of stride



49
50
51
# File 'lib/cohere/transcribe/pytorch_checkpoint.rb', line 49

def stride
  @stride
end

Instance Method Details

#element_countObject



53
54
55
# File 'lib/cohere/transcribe/pytorch_checkpoint.rb', line 53

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

#floating_point?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/cohere/transcribe/pytorch_checkpoint.rb', line 57

def floating_point?
  FLOAT_DTYPES.include?(dtype)
end