We are going to see how to access the Tensor as a lisp object.
[generic] change-facet
(change-facet obj direction)
change-facet converts obj to the data type specified by direction.
During the conversion process, it attempts to synchronize the Buffer (i.e., no copying is performed).
By default, :direction could be one of :tensor, :simple-array, :array.
Binds the result of (change-facet object direction) to the bind.
[macro] with-facets
(with-facets ((&rest input-forms) &body body))
Expands to a series of with-facet forms.
If you want to access an individual element of Tensor, it is wiser to convert it into an Array. The following code snippet initializes the diagonal of a Tensor to 0.0 without creating a copy: