TensorSpec

data class TensorSpec(val name: String, val shape: List<Int>?, val dtype: String, val requiresGrad: Boolean = false, val metadata: Map<String, Any> = emptyMap())(source)

Specification for a tensor in the graph, containing shape and type information

Constructors

Link copied to clipboard
constructor(name: String, shape: List<Int>?, dtype: String, requiresGrad: Boolean = false, metadata: Map<String, Any> = emptyMap())

Properties

Link copied to clipboard

Data type of the tensor

Link copied to clipboard

Additional metadata for this tensor

Link copied to clipboard

Name/identifier of this tensor

Link copied to clipboard

Whether this tensor requires gradients

Link copied to clipboard
val shape: List<Int>?

Shape of the tensor (null for dynamic shapes)