---
title: "ClikaRT::ops::expand_as"
sidebar_label: "expand_as"
description: "expand to other's shape; other supplies extents only; its data is never read. Same broadcasting rules and view semantics as expand."
---

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

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

## expand\_as() {#expand_as}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`expand_as`**([`Tensor`](../Tensor.md) `input`, [`Tensor`](../Tensor.md) `other`)

</div>

[`expand`](./expand.md#expand) to `other`'s shape; `other` supplies extents only; its data is never read. Same broadcasting rules and view semantics as [`expand`](./expand.md#expand).

**Throws**

- `ClikaRT::Error`: (`INVALID_ARGUMENT`) when a non-1 input dim mismatches `other`'s (`code_name()` carries the reason).

**Returns:** a view of `input` shaped like `other`.

<div class="api-declared">

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

</div>
