def _check_constant_args_pool(ndim, ws, stride, pad, node):
 try:
  ws = tuple((tensor.get_scalar_constant_value(ws[i]) for i in range(ndim)))
  stride = tuple((tensor.get_scalar_constant_value(stride[i]) for i in range(ndim)))
  pad = tuple((tensor.get_scalar_constant_value(pad[i]) for i in range(ndim)))
 except tensor.NotScalarConstantError:
  msg = ('Pool with tensor variable for the window size, stride or padding is only supported in the new GPU backend, so this op will run on CPU. (op %s)' % node)
  if (config.assert_no_cpu_op == 'warn'):
   _logger.warning(msg)
  elif (config.assert_no_cpu_op == 'raise'):
   raise AssertionError(msg)
  return None
 return (ws, stride, pad)

def _check_constant_args_pool ( ndim , ws , stride , pad , node ) : try : ws = tuple ( ( tensor . get_scalar_constant_value ( ws [ i ] ) for i in range ( ndim ) ) ) stride = tuple ( ( tensor . get_scalar_constant_value ( stride [ i ] ) for i in range ( ndim ) ) ) pad = tuple ( ( tensor . get_scalar_constant_value ( pad [ i ] ) for i in range ( ndim ) ) ) except tensor . NotScalarConstantError : msg = ( 'Pool with tensor variable for the window size, stride or padding is only supported in the new GPU backend, so this op will run on CPU. (op %s)' % node ) if ( config . assert_no_cpu_op == 'warn' ) : _logger . warning ( msg ) elif ( config . assert_no_cpu_op == 'raise' ) : raise AssertionError ( msg ) return None return ( ws , stride , pad )
check if the args of pool are constants .