o

lamp.data

Writer

object Writer

Binary serialization for Tensor with primitive Double, Float, Long

The layout of binary format is as follows: - The first 6 bytes are "LAMP" - The next unsigned byte is the major version - The next unsigned byte is the minor version - The next 4 bytes form a little endian integer as HEADER_LENGTH - The next HEADER_LENGTH bytes form an UTF-8 string as the header. - The header is a valid JSON object with the following fields:

  • v: numeric positive integer is the version of the header structure
  • shape: numeric array
  • datatype : string, either "double", "long", "int", "float", "byte" - The header is padded with spaces (0x20) such that HEADER_LENGTH+12 is divisible by 16. The count of spaces are included in HEADER_LENGTH. - The next width * shape.reduce(_ * _) bytes form a little endian primitive array.
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Writer
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val KEY_datatype: String
  5. val KEY_shape: String
  6. val KEY_v: String
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def createHeader(descriptor: Either[String, String]): Either[String, Array[Byte]]
  10. def createTensorDescriptor[T](tensor: Tensor)(implicit arg0: ST[T]): Either[String, String]
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. def put[T](t: Array[T], bb: ByteBuffer)(implicit arg0: ST[T]): Either[String, Unit]
  21. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  22. def tensorToArray[T](tensor: Tensor, elem: Int)(implicit arg0: ST[T]): Array[T]
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  27. def writeCheckpoint[A, B](file: File, model: GenericModule[A, B]): IO[Either[String, Seq[Unit]]]
  28. def writeFully(bb: ByteBuffer, channel: WritableByteChannel): Unit
  29. def writeTensorIntoArray[T](tensor: Tensor)(implicit arg0: ST[T]): Either[String, Array[Byte]]
  30. def writeTensorIntoChannel[T](tensor: Tensor, channel: WritableByteChannel)(implicit arg0: ST[T]): Either[String, Unit]
  31. def writeTensorsIntoChannel(tensors: Seq[Tensor], channel: WritableByteChannel): Either[String, Seq[Unit]]

Inherited from AnyRef

Inherited from Any

Ungrouped