Library/ManagedCuda/CudaDNN/CudaDNNContext.cs
/// <summary>
/// This function scale all the elements of a tensor by a give factor.
/// </summary>
/// <param name="yDesc">Handle to a previously initialized tensor descriptor.</param>
/// <param name="y">Pointer to data of the tensor described by the srcDestDesc descriptor.</param>
/// <param name="alpha">Pointer in Host memory to a value that all elements of the tensor will be scaled with.</param>
This function scale all the elements of a tensor by a give factor.
This function scale all the elements of a tensor by a give factor .
public void ScaleTensor(TensorDescriptor yDesc,
                                        CudaDeviceVariable<float> y,
                                        float alpha
                                    )
        {
            res = CudaDNNNativeMethods.cudnnScaleTensor(_handle, yDesc.Desc, y.DevicePointer, ref alpha);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnScaleTensor", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
        }
public void ScaleTensor ( TensorDescriptor yDesc , CudaDeviceVariable < float > y , float alpha ) { res = CudaDNNNativeMethods . cudnnScaleTensor ( _handle , yDesc . Desc , y . DevicePointer , ref alpha ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cudnnStatus . Success ) throw new CudaDNNException ( res ) ; }
This function scale all the elements of a tensor by a give factor.
This function scale all the elements of a tensor by a give factor .
yDesc
TensorDescriptor
Handle to a previously initialized tensor descriptor.
Handle to a previously initialized tensor descriptor .
y
CudaDeviceVariable<float>
Pointer to data of the tensor described by the srcDestDesc descriptor.
Pointer to data of the tensor described by the srcDestDesc descriptor .
alpha
float
Pointer in Host memory to a value that all elements of the tensor will be scaled with.
Pointer in Host memory to a value that all elements of the tensor will be scaled with .