Package

com.stripe.agate

tensor

Permalink

package tensor

Visibility
  1. Public
  2. All

Type Members

  1. final class BFloat16 extends AnyVal

    Permalink

    BFloat16 represents 16-bit floating-point values.

    BFloat16 represents 16-bit floating-point values.

    This type does not actually support arithmetic directly. The expected use case is to convert to Float to perform any actual arithmetic, then convert back to a BFloat16 if needed.

    Binary representation:

    sign (1 bit) | | exponent (8 bits) | | | | mantissa (7 bits) | | | x xxxxxxxx xxxxxxx

    Value interpretation (in order of precedence, with _ wild):

    0 00000000 0000000 (positive) zero 1 00000000 0000000 negative zero _ 00000000 _ subnormal number _ 11111111 0000000 +/- infinity _ 11111111 _ not-a-number _ _ normal number

    An exponent of all 1s signals a sentinel (NaN or infinity), and all 0s signals a subnormal number. So the working "real" range of exponents we can express is [-126, +127].

    For non-zero exponents, the mantissa has an implied leading 1 bit, so 7 bits of data provide 8 bits of precision for normal numbers.

    For normal numbers:

    x = (1 - sign*2) * 2^exponent * (1 + mantissa/128)

    For subnormal numbers, the implied leading 1 bit is absent. Thus, subnormal numbers have the same exponent as the smallest normal numbers, but without an implied 1 bit.

    So for subnormal numbers:

    x = (1 - sign*2) * 2^(-127) * (mantissa/128)

  2. trait Build[H, E] extends AnyRef

    Permalink

    Shapeless-powered type-class used to build literal tensors.

  3. trait BuildLowPri extends AnyRef

    Permalink
  4. sealed abstract class DataType extends AnyRef

    Permalink
  5. final class Float16 extends AnyVal

    Permalink

    Float16 represents 16-bit floating-point values.

    Float16 represents 16-bit floating-point values.

    This type does not actually support arithmetic directly. The expected use case is to convert to Float to perform any actual arithmetic, then convert back to a Float16 if needed.

    Binary representation:

    sign (1 bit) | | exponent (5 bits) | | | | mantissa (10 bits) | | | x xxxxx xxxxxxxxxx

    Value interpretation (in order of precedence, with _ wild):

    0 00000 0000000000 (positive) zero 1 00000 0000000000 negative zero _ 00000 subnormal number _ 11111 0000000000 +/- infinity _ 11111 not-a-number _ _ normal number

    An exponent of all 1s signals a sentinel (NaN or infinity), and all 0s signals a subnormal number. So the working "real" range of exponents we can express is [-14, +15].

    For non-zero exponents, the mantissa has an implied leading 1 bit, so 10 bits of data provide 11 bits of precision for normal numbers.

    For normal numbers:

    x = (1 - sign*2) * 2^exponent * (1 + mantissa/1024)

    For subnormal numbers, the implied leading 1 bit is absent. Thus, subnormal numbers have the same exponent as the smallest normal numbers, but without an implied 1 bit.

    So for subnormal numbers:

    x = (1 - sign*2) * 2^(-14) * (mantissa/1024)

  6. sealed trait OnnxFloating[A] extends OnnxNumber[A]

    Permalink

    Onnx has several types of Integral numbers

  7. sealed trait OnnxIntegral[A] extends OnnxNumber[A]

    Permalink

    Onnx has several types of Integral numbers

  8. sealed trait OnnxNumber[A] extends AnyRef

    Permalink

    represent Onnx's notion of a number

  9. trait ScalarParser[E] extends AnyRef

    Permalink
  10. sealed abstract class Shape[+A] extends AnyRef

    Permalink
  11. sealed trait Storage[A] extends AnyRef

    Permalink
  12. sealed abstract class StorageAllocator[A] extends AnyRef

    Permalink
  13. abstract class Tensor[D <: DataType] extends AnyRef

    Permalink
  14. sealed abstract class TensorException extends Exception

    Permalink
  15. class TensorParser[D <: DataType] extends AnyRef

    Permalink

    Parser tensors from numpy output strings useful for testing

  16. trait ToBytes[A] extends AnyRef

    Permalink

    A type class for serializing values of type A into bytes.

  17. sealed trait WritableStorage[A] extends AnyRef

    Permalink

Value Members

  1. object BFloat16

    Permalink
  2. object Build extends BuildLowPri

    Permalink
  3. object DataType

    Permalink
  4. object Float16

    Permalink
  5. object OnnxNumber

    Permalink
  6. object OnnxShow

    Permalink
  7. object ScalarParser

    Permalink
  8. object Shape

    Permalink
  9. object Storage

    Permalink
  10. object StorageAllocator

    Permalink
  11. object Tensor

    Permalink
  12. object TensorException extends Serializable

    Permalink
  13. object TensorParser

    Permalink
  14. object ToBytes

    Permalink
  15. object WritableStorage

    Permalink

Ungrouped