---
title: "ClikaRT::ops::zeros_like"
sidebar_label: "zeros_like"
description: "A zero-filled tensor with reference's shape and dtype (data never read); device absent = the reference's own device."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--function">function</span>

## zeros\_like() {#zeros_like}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`zeros_like`**([`Tensor`](../Tensor.md) `reference`, [`StreamOrDevice`](../StreamOrDevice.md) `device` `=` `{}`)

</div>

A zero-filled tensor with `reference`'s shape and dtype (data never read); [`device`](../device-namespace/index.md) absent = the reference's own device.

**Throws**

- `ClikaRT::Error`: when the input's dtype is not served for this operation (the machine-readable reason rides `code_name()`).

**Returns:** a new zero-filled tensor shaped like `reference`.

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 2473

</div>
