Basic Tensors in IronPython QuickStart Sample

Illustrates the basic use of the Tensor class for working with tensors in IronPython.

This sample is also available in: C#, Visual Basic, F#.

Overview

This QuickStart sample demonstrates the fundamental operations for creating and working with tensors in Numerics.NET.

The sample shows various ways to construct tensors, from simple scalar values to multi-dimensional arrays. It demonstrates creating tensors from arrays, memory blocks, and generator functions. Key features covered include:

  • Creating scalar tensors
  • Constructing tensors from arrays and memory blocks
  • Generating tensors using functions
  • Creating tensors with ranges and random values
  • Accessing tensor properties like rank, shape, and layout

The sample provides practical examples of each approach, with explanatory comments showing the expected output. This makes it an excellent starting point for developers new to tensor operations in Numerics.NET, while also serving as a quick reference for common tensor creation patterns.

The code

Coming soon...