|
Baremetal-NN
Baremetal-NN API documentation
|
Tensors can be initialized in various ways. A set of factory functions are available for creating a tensor object. These factory functions configure the shape, data type, device and other properties of the new tensor, and optionally populate them according to specific algorithms.
A factory function is a function that produces a new tensor. There are many factory functions available, which differ in the way they initialize a new tensor before returning it. All factory functions adhere to the following general "schema”:
The following factory functions are available at the time of this writing:
Returns a tensor with uninitialized values or preallocated buffer.
When passing NULL as the data buffer, the method will allocate a new chunk of uninitialized data chunk.
Alternatively, tensor be created directly from an existing data buffer.
Returns a tensor filled with all zeros.
Returns a tensor filled with all ones.
Returns a tensor filled with a single value.
Returns a tensor filled with values drawn from a uniform distribution on [0, 1).