---
title: "ClikaRT::ops::full_like"
sidebar_label: "full_like"
description: "A new tensor with reference's shape and dtype, filled with fill_value."
---

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

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

## full\_like() {#full_like}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`full_like`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `reference`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`ScalarOrTensor`](../ScalarOrTensor.md) `fill_value`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`StreamOrDevice`](../StreamOrDevice.md) `device` `=` `{}`<br />
)

</div>

A new tensor with `reference`'s shape and dtype, filled with `fill_value`.

`fill_value` takes the same forms as [`full`](./full.md#full)'s: a bool, an integer, a double, or a tensor (0-D, or broadcastable to the reference's shape).

**Parameters**

- `reference`: shape/dtype donor; its data is never read.
- `fill_value`: the value, cast to the reference's dtype.
- `device`: stream or device; absent = the reference's own device. Default: absent.

**Throws**

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

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

<div class="api-declared">

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

</div>
