singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [singa] nudles commented on a change in pull request #625: [WIP]tensor.AsType()
Date Thu, 12 Mar 2020 06:35:44 GMT
nudles commented on a change in pull request #625: [WIP]tensor.AsType()
URL: https://github.com/apache/singa/pull/625#discussion_r391424684
 
 

 ##########
 File path: src/core/tensor/math_kernel.cu
 ##########
 @@ -184,6 +184,20 @@ __global__ void KernelAbs(const size_t n, const float *in, float *out)
{
   }
 }
 
+__global__ void KernelAsType2(const size_t n, const float *in, int *out) {
+  for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < n;
+       i += blockDim.x * gridDim.x) {
+    out[i] = in[i];
 
 Review comment:
   do you need the cast operation like `out[i]=int(in[i])?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message