fromTensor

fun <T : DType, V> fromTensor(tensor: Tensor<T, V>, layout: ImageLayout, colorSpace: ColorSpace): Image<T, V>(source)

Create an Image from an existing tensor with explicit metadata.

Return

A new Image wrapping the tensor

Parameters

tensor

The tensor data

layout

Memory layout of the tensor

colorSpace

Color space interpretation

Throws

if tensor rank doesn't match layout


fun <T : DType, V> fromTensor(tensor: Tensor<T, V>, layout: ImageLayout): Image<T, V>(source)

Create an Image from a tensor, inferring color space from channel count.

Return

A new Image with inferred color space

Parameters

tensor

The tensor data

layout

Memory layout of the tensor