, x.shape]Ĭrop the start and end of dimensions of reshapedPermutedĪccording to crops to produce the output of shape: * blockShape - crops - crops. Reshape permuted to produce reshapedPermuted of shape * blockShape. Permute dimensions of reshaped to produce permuted of shape, blockShape. , blockShape, batch / prod(blockShape), x.shape. This operation is equivalent to the following steps: That cropStart + cropEnd <= blockShape * inputShape Must have shape, all values must be >= 0.Ĭrops = specifies the amount to crop from inputĭimension i + 1, which corresponds to spatial dimension i. N-D with x.shape = + spatialShape + remainingShape, where spatialShape has M dimensions. x ( tf.Tensor| TypedArray|Array) A tf.Tensor.shape (number) The shape of the tensor.ZeroCopy is true, this GPUBuffer is bound directly by the tensor, so do notĭestroy this GPUBuffer until all access is done. This passing GPUBuffer can be destroyed after tensor is created. When zeroCopy is false or undefined(default), buffer.size should notīe smaller than the byte size of tensor shape. GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC 3. Object, the dtype could only be 'float32' or 'int32 and the object has to Size, zeros will be padded at the rear.). (If the values passed from texture is less than the tensor Tensor, such as 'R' or 'BR' (The order of the channels affect the order of Of 'RGBA', indicating the values of which channels will be passed to the Texture's canvas) and the internal texture format for the input texture mustīe floating point or normalized integer 2. TFJS's WebGL backend (you could create a custom WebGL backend from your WebGLTexture, the texture must share the same WebGLRenderingContext with If the values is a WebGLData object, the dtypeĬould only be 'float32' or 'int32' and the object has to have: 1. If the values are strings, they will be encoded as utf-8Īnd kept as Uint8Array. Or a flat array, or a TypedArray, or a WebGLData object, or a values ( TypedArray|Array|WebGLData|WebGPUData) The values of the tensor.findBackend( 'custom-webgl') = null), shape, dtype) Ĭonst b = tf. For example, if your application includes a preprocessing step on the GPU, // you could upload the GPU output directly to TF.js, rather than first // downloading the values. This makes it possible for TF.js applications to avoid GPU / CPU sync. Pass a `WebGLData` object and specify a shape yourself. Pass a flat array and specify a shape yourself. Pass a nested array of values to make a matrix or a higher // dimensional tensor. Pass an array of values to create a vector. Creates a tf.Tensor with the provided values, shape and dtype.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |