Use pygpu_empty instead pygpu_zeros and remove memset in spatialtf_grid

上级 c209e164
......@@ -58,11 +58,11 @@ spatialtf_grid(PyArrayObject * grid_dimensions,
}
if ( NULL == *grid ||
! theano_size_check( *grid, 4, &(grid_dims[0]), (*grid)->ga.typecode ) )
! theano_size_check( *grid, 4, grid_dims, (*grid)->ga.typecode ) )
{
Py_XDECREF( *grid );
*grid = pygpu_zeros( 4, &(grid_dims[0]), theta->ga.typecode, GA_C_ORDER,
*grid = pygpu_empty( 4, grid_dims, theta->ga.typecode, GA_C_ORDER,
gpu_ctx, Py_None );
if ( NULL == *grid )
{
......@@ -71,10 +71,6 @@ spatialtf_grid(PyArrayObject * grid_dimensions,
return -1;
}
}
else
{
GpuArray_memset( &( (*grid)->ga ), 0 );
}
if ( ! GpuArray_IS_C_CONTIGUOUS( &(theta->ga) ) )
{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论