NAME

AI::MXNet::Function::Parameters - Read/write RecordIO format data

new

Parameters ---------- uri : Str uri path to recordIO file. flag: Str "r" for reading or "w" writing.

open

Open record file

close

Close record file

reset

Reset pointer to first item. If record is opened with 'w', this will truncate the file to empty.

write

Write a string buffer as a record

Parameters ---------- $buf : buffer to write.

read

Read a record as string

Returns ---------- $buf : string

unpack

unpack a MXImageRecord to a string

Parameters ---------- s : str string buffer from MXRecordIO.read

Returns ------- header : AI::MXNet::IRHeader header of the image record s : str unpacked string

pack

pack a string into MXImageRecord

Parameters ---------- $header : AI::MXNet::IRHeader or ArrayRef suitable for AI::MXNet::IRHeader->new(@{ ArrayRef }) header of the image record. $header->label can be a number or an array ref. s : str string to pack

NAME

AI::MXNet::IndexedRecordIO - Read/write RecordIO format data supporting random access.

new

Parameters ---------- idx_path : str Path to index file uri : str Path to record file. Only support file types that are seekable. flag : str 'w' for write or 'r' for read

seek

Query current read head position

tell

Query current write head position

read_idx

Read record with index

Parameters: $idx

write_idx

Write record with index

Parameters: $idx, $buf