nvidia.dali.fn.ones_like#
- nvidia.dali.fn.ones_like(
- data_like,
- /,
- *,
- device=None,
- name=None,
- bytes_per_sample_hint=[0],
- dtype=DALIDataType.INT32,
- preserve=False,
Returns new data with the same shape, type and layout as the input array, filled with ones.
- Supported backends
‘cpu’
- Parameters:
data_like¶ (TensorList) – The input data value to copy the shape, type and layout from.
- Keyword Arguments:
bytes_per_sample_hint¶ (int or list of int, optional, default = [0]) –
Output size hint, in bytes per sample.
If specified, the operator’s outputs residing in GPU or page-locked host memory will be preallocated to accommodate a batch of samples of this size.
dtype¶ (
nvidia.dali.types.DALIDataType, optional, default = DALIDataType.INT32) – Overrides the output data type.preserve¶ (bool, optional, default = False) – Prevents the operator from being removed from the graph even if its outputs are not used.