int8.empty — Create an empty int8 array.
The int8 class receiver selects exact host storage. Dimension controls determine the empty shape, not the output class.
Syntax
A = ClassName.empty
A = ClassName.empty(sz1, ..., szN)
A = ClassName.empty(sizeVector)Inputs
dimensions- Type
SizeArg- Required
- Variadic
- Default
- —
- Description
- Integer scalar dimensions; at least one dimension must be zero.
sizeVector- Type
SizeArg- Required
- Yes
- Default
- —
- Description
- Row vector of integer dimensions; at least one dimension must be zero.
Returns
A- Type
Any- Description
- Empty array preserving the receiver class.
Errors
RunMat:empty:InvalidSize- When
- Size arguments are not integer-valued numeric scalars or one row size vector.
- Message
empty: invalid size arguments
RunMat:empty:NonEmptyShape- When
- Every normalized dimension is nonzero.
- Message
empty: at least one dimension must be zero
RunMat:empty:UnsupportedClass- When
- The selected shorthand class cannot be represented as a shaped empty value.
- Message
empty: unsupported output class
Behavior
RunMat registers class-qualified forms for int8.empty, int16.empty, int32.empty, int64.empty, uint8.empty, uint16.empty, uint32.empty, and uint64.empty.
All eight integer classes are accepted for scalar dimension controls and row size vectors. Values are decoded from authoritative integer storage without conversion through double.
Signed negative dimensions become zero. Nonnegative dimensions must be integer-valued and within the platform size range.
A single scalar dimension requests a square shape. A size-vector argument must be a row vector; column vectors reject.
Trailing singleton dimensions after dimension two are removed. At least one remaining dimension must be zero.
Integer outputs contain exact empty IntegerStorage of the receiver class.
The global empty(...) shorthand and its trailing typename selector are RunMat-only extensions. MATLAB-compatible mode requires class-qualified syntax.
The former global "like" shorthand is not retained because it did not inherit output class and is not part of the documented class-static surface.
User-defined and general object-class empty arrays require broader class-array storage and static-method dispatch support.
GPU residency and provider behavior
Integer class-static forms construct host empty storage. Resident numeric size controls are accepted only in RunMat mode and reject before provider access when extensions are disabled.
Primitive integer ClassName.empty forms construct exact host integer storage. A resident size control is a compatibility-gated RunMat extension and is gathered only after validation and gating.
Syntax
A = ClassName.empty
A = ClassName.empty(sz1, ..., szN)
A = ClassName.empty(sizeVector)
At least one normalized dimension must be zero.
A size vector must be a row vector.
Signed negative dimensions are treated as zero.
Trailing singleton dimensions after dimension two are omitted.
Examples
Create an empty int8 matrix
A = int8.empty(0, 5);Preserve a normalized N-D empty shape
A = int8.empty(int32([0 2 3 1]));Using int8.empty with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how int8.empty changes the result.
Run a small int8.empty example, explain the result, then change one input and compare the output.
FAQ
Does the class come from a size argument?⌄
No. In MATLAB-compatible syntax the receiver in ClassName.empty determines the output class. Integer size arguments are structural controls only.
Are wide uint64 dimensions converted through double?⌄
No. Host integer controls are decoded exactly from integer storage and checked against the platform size range.
Can empty create a nonempty array?⌄
No. After signed-negative clamping and trailing-singleton normalization, at least one dimension must be zero.
Can I call empty as a global function?⌄
Only in RunMat mode. The global shorthand is explicitly compatibility-gated; portable MATLAB-compatible code uses ClassName.empty.
Related Array functions
Creation
colon · createArray · empty · eye · false · full · inf · int16.empty · int32.empty · int64.empty · linspace · logspace · magic · meshgrid · nan · ndgrid · nonzeros · ones · peaks · rand · randi · randn · randperm · range · sparse · spdiags · speye · spones · sprand · true · uint16.empty · uint32.empty · uint64.empty · uint8.empty · zeros
Accumulation
Sorting Sets
argsort · intersect · ismember · ismembertol · issorted · issortedrows · setdiff · setxor · sort · sortrows · union · unique
Shape
blkdiag · cat · circshift · diag · flip · fliplr · flipud · horzcat · ipermute · kron · permute · repelem · repmat · reshape · rot90 · shiftdim · squeeze · toeplitz · tril · triu · vertcat
Combinatorics
Binning
Grouping
About RunMat
RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/license.
- RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
- Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.