---
title: "ClikaRT::ops::ndim"
sidebar_label: "ndim"
description: "The tensor's rank as a 0-D Int64 tensor. The value is produced ON DEVICE and is traceable; under tracing it carries the symbolic value. For a plain host integer use the *_host sibling instead."
---

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

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

## ndim() {#ndim}

<div class="api-signature">

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

</div>

The tensor's rank as a 0-D Int64 tensor.

The value is produced ON DEVICE and is traceable; under tracing it carries the symbolic value. For a plain host integer use the `*_host` sibling instead.

**Throws**

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

**Returns:** 0-D Int64.

<div class="api-declared">

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

</div>
