An intermediate expression of tensor that can be composed into a more complex expression.
An intermediate expression of tensor that can be composed into a more complex expression.
Returns an uninitialized buffer of Element
on device.
Returns an uninitialized buffer of Element
on device.
Returns a buffer of Element
on device whose content is copied from hostBuffer
.
Returns a buffer of Element
on device whose content is copied from hostBuffer
.
Creates single kernel from this Program.
Creates single kernel from this Program.
com.thoughtworks.compute.OpenCL.Exceptions.InvalidValue
if the this Program has more than one kernel.
Contains N-dimensional array types on CPU.
You may want to import Tensor, which is the base type of N-dimensional arrays:
import com.thoughtworks.compute.cpu.Tensor
Multiple
Tensor
s of the sameshape
can be merged into a largerTensor
via theTensor.join
function. Given aSeq
of three 2x2Tensor
s,when
join
ing them,val merged: Tensor = Tensor.join(mySubtensors)
then the result should be a 2x2x3
Tensor
.A
Tensor
can besplit
into smallTensor
s on the direction of a specific dimension. Given a 3D tensor whoseshape
is 2x3x4,when
split
it at the dimension #0,then the result should be a
Seq
of two 3x4 tensors.When
split
it at the dimension #1,then the result should be a
Seq
of three 2x4 tensors.In Compute.scala, an N-dimensional array is typed as Tensor, which can be created from scala.collection.Seq or scala.Array.