---
title: "ClikaRT::ops::atleast_2d"
sidebar_label: "atleast_2d"
description: "input with leading size-1 dims prepended until rank >= 2 (see atleast_1d). Returns a view (no copy)."
---

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

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

## atleast\_2d() {#atleast_2d}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`atleast_2d`**([`Tensor`](../Tensor.md) `input`)

</div>

`input` with leading size-1 dims prepended until rank \>= 2 (see [`atleast_1d`](./atleast_1d.md#atleast_1d)). Returns a view (no copy).

**Throws**

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

**Returns:** a view of `input` with rank \>= 2.

<div class="api-declared">

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

</div>
