def max_inputs_to_GpuElemwise(node):
 type_sizes = get_device_type_sizes()
 int_size = type_sizes['int_size']
 gpu_ptr_size = type_sizes['gpu_ptr_size']
 argument_limit = 232
 ndim = node.inputs[0].type.ndim
 size_param_mandatory = int_size
 size_param_mandatory += (int_size * ndim)
 size_param_mandatory += sum(((gpu_ptr_size + (int_size * ndim)) for i in node.outputs))
 nb_bytes_avail = (argument_limit - size_param_mandatory)
 nb_bytes_per_inputs = ((ndim * int_size) + gpu_ptr_size)
 max_nb_inputs = (nb_bytes_avail // nb_bytes_per_inputs)
 if ((node.inputs[0].type.ndim == 1) and (max_nb_inputs > 14)):
  return 14
 return max_nb_inputs

def max_inputs_to_GpuElemwise ( node ) : type_sizes = get_device_type_sizes ( ) int_size = type_sizes [ 'int_size' ] gpu_ptr_size = type_sizes [ 'gpu_ptr_size' ] argument_limit = 232 ndim = node . inputs [ 0 ] . type . ndim size_param_mandatory = int_size size_param_mandatory += ( int_size * ndim ) size_param_mandatory += sum ( ( ( gpu_ptr_size + ( int_size * ndim ) ) for i in node . outputs ) ) nb_bytes_avail = ( argument_limit - size_param_mandatory ) nb_bytes_per_inputs = ( ( ndim * int_size ) + gpu_ptr_size ) max_nb_inputs = ( nb_bytes_avail // nb_bytes_per_inputs ) if ( ( node . inputs [ 0 ] . type . ndim == 1 ) and ( max_nb_inputs > 14 ) ) : return 14 return max_nb_inputs
return the maximum number of inputs this gpuelemwise apply node can accept .