empty#

Fully qualified name: isaacsim::common::array::empty

Array isaacsim::common::array::empty(
const Shape &shape,
Dtype dtype = Dtype::Float64(),
const Device &device = Device::Cpu(),
)#

Creates an array of the given shape without initializing its elements.

The returned array owns a freshly allocated buffer whose contents are unspecified: read an element before writing it and you get whatever the allocator handed back. Use it only when every element is about to be overwritten; reach for zeros() or ones() otherwise.

A zero-element shape still allocates, so Array::data() is a valid, distinct pointer rather than null.

Parameters:
  • shape – [in] Shape of the new array. An empty shape produces a 0-D array holding one element.

  • dtype – [in] Element type. Defaults to float64.

  • device – [in] Device on which to allocate. Defaults to the CPU.

Returns:

A new Array with uninitialized elements.