Gets the information about the operators input/output types.
356455
@Override
	@SuppressWarnings("unchecked")
	public UnaryOperatorInformation<IN, OUT> getOperatorInfo() {
		return (UnaryOperatorInformation<IN, OUT>) this.operatorInfo;
	}
617632
def is_binary_operator(oper):
    """"""
    # definition:
    # member in class
    # ret-type operator symbol(arg)
    # globally
    # ret-type operator symbol( arg1, arg2 )
    symbols = [
        ',', '()', '[]', '!=', '%', '%=', '&', '&&', '&=', '*', '*=', '+',
        '+=', '-', '-=', '->', '->*', '/', '/=', '<', '<<', '<<=', '<=', '=',
        '==', '>', '>=', '>>', '>>=', '^', '^=', '|', '|=', '||']
    if not isinstance(oper, calldef_members.operator_t):
        return False
    if oper.symbol not in symbols:
        return False

    if isinstance(oper, calldef_members.member_operator_t):
        if len(oper.arguments) == 1:
            return True
        return False

    if len(oper.arguments) == 2:
        return True
    return False
374387
def get_type_for_inputs(table):
        
        return [
            dict(
                type=INPUT_TYPES.get(
                    type(field_type.type), rc.TEXT_INPUT.value
                ),
                name=name,
                isPrimaryKey=(name in table.primary_key),
                props=None,
            ) for name, field_type in table.c.items()
        ]
835211
def interfaces(self):
        """"""

        ifaces = []

        if self._wlan_open_handle(CLIENT_VERSION,
                                  byref(self._nego_version),
                                  byref(self._handle)) \
           is not ERROR_SUCCESS:
            self._logger.error("Open handle failed!")

        if self._wlan_enum_interfaces(self._handle, byref(self._ifaces)) \
           is not ERROR_SUCCESS:
            self._logger.error("Enum interface failed!")

        interfaces = cast(self._ifaces.contents.InterfaceInfo,
                     POINTER(WLAN_INTERFACE_INFO))
        for i in range(0, self._ifaces.contents.dwNumberOfItems):
            iface = {}
            iface['guid'] = interfaces[i].InterfaceGuid
            iface['name'] = interfaces[i].strInterfaceDescription
            ifaces.append(iface)

        return ifaces
203754
def calculate_feature_vectorizer_output_shapes(operator):
    '''
    
    '''
    check_input_and_output_numbers(operator, input_count_range=[1, None], output_count_range=1)
    check_input_and_output_types(operator, good_input_types=[FloatTensorType, Int64TensorType, FloatType, Int64Type])

    if any(len(variable.type.shape) != 2 for variable in operator.inputs):
        raise RuntimeError('Input(s) must be 2-D tensor(s)')

    # Find the first batch size which is not unknown
    N = 'None'
    for variable in operator.inputs:
        if variable.type.shape[0] != 'None':
            N = variable.type.shape[0]
            break
    for variable in operator.inputs:
        if variable.type.shape[0] not in ['None', N]:
            raise RuntimeError('The batch dimensions should be the same to all input tensors.')

    C = sum(info.inputDimensions for info in operator.raw_operator.featureVectorizer.inputList)

    # Currently, we only expect numerical inputs. If both of integers and floats exist, we may convert integers into
    # floats before concatenating them. Thus, the output type is integer-like only if all inputs are integer-like.
    doc_string = operator.outputs[0].type.doc_string
    if all(isinstance(variable.type, (Int64TensorType, Int64Type)) for variable in operator.inputs):
        operator.outputs[0].type = Int64TensorType([N, C], doc_string=doc_string)
    elif isinstance(operator.inputs[0].type, (FloatTensorType, FloatType)):
        operator.outputs[0].type = FloatTensorType([N, C], doc_string=doc_string)
    else:
        raise ValueError('Unsupported input type: %s' % type(operator.inputs[0].type))
892347
def calculate_gru_output_shapes(operator):
    '''
    
    '''
    check_input_and_output_numbers(operator, input_count_range=[1, 2], output_count_range=[1, 2])
    check_input_and_output_types(operator, good_input_types=[FloatTensorType])

    input_shape = operator.inputs[0].type.shape

    if len(input_shape) not in [2, 4]:
        raise RuntimeError('Input must be a [N, C]- or [N, C, 1, 1]-tensor')

    if operator.type == 'gru':
        params = operator.raw_operator.gru
    elif operator.type == 'simpleRecurrent':
        params = operator.raw_operator.simpleRecurrent
    else:
        raise RuntimeError('Only GRU and SimpleRNN are supported')

    # The following line is more accurate but it may break some tests
    # output_shape = ['None', params.outputVectorSize] if params.params.sequenceOutput else [2, params.outputVectorSize]
    output_shape = [input_shape[0] if params.sequenceOutput else 'None', params.outputVectorSize]  # 'None' should be 1
    state_shape = [1, params.outputVectorSize]

    # TODO: Changing input shapes of an operator is dangerous, this should be move to Topology's _fix_shapes function
    if len(operator.inputs) > 1:
        Y_h_in = operator.inputs[1]  # The initial hidden state of a single sequence
        Y_h_in.type.shape = state_shape

    operator.outputs[0].type.shape = output_shape
    if len(operator.outputs) > 1:
        operator.outputs[1].type.shape = state_shape
420695
public static String operatorToString(int op) {
        String result = operatorNames.get(op);
        if (result == null)
            throw new IllegalArgumentException("Invalid operator: " + op);
        return result;
    }
316726
function parse_operator_type(op, def) {
	op = ''+op;
	if(op.indexOf(':') === -1) {
		return def || 'boolean';
	}
	return op.split(':')[1];
}
265053
def properties_operator(cls, name):
    """"""

    def wrapper(self, *args, **kwargs):
        """Perform operation and cast to container class"""
        output = getattr(super(cls, self), name)(*args, **kwargs)
        return cls(output)

    wrapped = getattr(cls, name)
    wrapper.__name__ = wrapped.__name__
    wrapper.__doc__ = wrapped.__doc__
    return wrapper
808172
def get_block_operator(self):
        """"""
        # Top level operator is `and`
        block_stack = ['and']
        for f in self.manager.iter_filters(block_end=True):
            if f is None:
                block_stack.pop()
                continue
            if f.type in ('and', 'or', 'not'):
                block_stack.append(f.type)
            if f == self:
                break
        return block_stack[-1]
727796
def _infer_all_types(self):
        '''
        
        '''
        self._initialize_graph_status_for_traversing()

        # Deliver user-specified types to root variables
        for raw_name, initial_type in self.initial_types:
            # Check all variables declared using raw_name in the whole graph
            for scope in self.scopes:
                # Skip scopes without having the considered variable name
                if raw_name not in scope.variable_name_mapping:
                    continue
                # Assign initial_type to all variables declared using raw_name
                for onnx_name in scope.variable_name_mapping[raw_name]:
                    variable = scope.variables[onnx_name]
                    if variable.is_root:
                        # Assign type to the root; existing type produced by parser may be overwritten
                        variable.type = initial_type

        # Traverse the graph from roots to leaves
        for operator in self.topological_operator_iterator():
            if operator.type in self.custom_shape_calculators:
                self.custom_shape_calculators[operator.type](operator)
            elif operator.type in self.custom_conversion_functions:
                pass  # in Keras converter, the shape calculator can be optional.
            else:
                operator.infer_types()
1144434
def operator_names():
    
    return tuple('{}/{}'.format(provider_name, operator_name)
                 for provider_name, provider in OPERATOR_PROVIDERS.items()
                 for operator_name in provider)
157875
def calculate_reshape_output_shapes(operator):
    '''
    
    '''
    check_input_and_output_numbers(operator, input_count_range=1, output_count_range=1)
    check_input_and_output_types(operator, good_input_types=[FloatTensorType])

    params = operator.raw_operator.reshape

    output_shape = list(int(i) for i in params.targetShape)

    if len(output_shape) == 3:
        output_shape = [operator.inputs[0].type.shape[0]] + output_shape

    operator.outputs[0].type.shape = output_shape
526558
private static <E> TypeInformation<?>[] extractTypeInfos(PojoTypeInfo<E> pojoTypeInfo, String[] fieldNames) {
		Preconditions.checkNotNull(pojoTypeInfo);
		Preconditions.checkNotNull(fieldNames);
		Preconditions.checkArgument(pojoTypeInfo.getArity() >= fieldNames.length);
		TypeInformation<?>[] fieldTypes = new TypeInformation<?>[fieldNames.length];
		for (int i = 0; i < fieldNames.length; ++i) {
			String fieldName = fieldNames[i];
			Preconditions.checkNotNull(fieldName, "The field can't be null");
			int fieldPos = pojoTypeInfo.getFieldIndex(fieldName);
			Preconditions.checkArgument(fieldPos >= 0,
				String.format("Field %s is not a member of POJO type %s",
					fieldName, pojoTypeInfo.getTypeClass().getName()));
			fieldTypes[i] = pojoTypeInfo.getTypeAt(fieldPos);
		}

		return fieldTypes;
	}
725680
private String getTypes(int flags) {
        String types = "";
        if ((flags & CRT_STATEMENT)       != 0) types += " CRT_STATEMENT";
        if ((flags & CRT_BLOCK)           != 0) types += " CRT_BLOCK";
        if ((flags & CRT_ASSIGNMENT)      != 0) types += " CRT_ASSIGNMENT";
        if ((flags & CRT_FLOW_CONTROLLER) != 0) types += " CRT_FLOW_CONTROLLER";
        if ((flags & CRT_FLOW_TARGET)     != 0) types += " CRT_FLOW_TARGET";
        if ((flags & CRT_INVOKE)          != 0) types += " CRT_INVOKE";
        if ((flags & CRT_CREATE)          != 0) types += " CRT_CREATE";
        if ((flags & CRT_BRANCH_TRUE)     != 0) types += " CRT_BRANCH_TRUE";
        if ((flags & CRT_BRANCH_FALSE)    != 0) types += " CRT_BRANCH_FALSE";
        return types;
    }
1187827
def operator(self, operatorType, value):
        
        if value is None:
            if 'is none' in self._operatorMap and operatorType == Query.Op.Is:
                return 'is none'
            elif 'is not none' in self._operatorMap:
                return 'is not none'
            
        for op, data in self._operatorMap.items():
            if data.op == operatorType:
                return op
        return ''
966713
def get_operator_index(self, name):
        """"""
        opdefs = yield from self.get_operator_definitions()

        name = name.lower()
        if name not in opdefs:
            return None

        return opdefs[name]["index"]