mlir.dialects._ods_common¶
Functions¶
|
Returns a slice of elements corresponding to the idx-th segment. |
|
Returns a starting position and a number of elements per variadic group |
|
Returns a context in which the defaulted location is created. If the location |
|
Returns the given value or the single result of the given op. |
Returns the given sequence of values or the results of the given op. |
|
Module Contents¶
- mlir.dialects._ods_common.segmented_accessor(elements, raw_segments, idx)¶
Returns a slice of elements corresponding to the idx-th segment.
elements: a sliceable container (operands or results). raw_segments: an mlir.ir.Attribute, of DenseI32Array subclass containing sizes of the segments. idx: index of the segment.
- mlir.dialects._ods_common.equally_sized_accessor(elements, n_simple, n_variadic, n_preceding_simple, n_preceding_variadic)¶
Returns a starting position and a number of elements per variadic group assuming equally-sized groups and the given numbers of preceding groups.
elements: a sequential container. n_simple: the number of non-variadic groups in the container. n_variadic: the number of variadic groups in the container. n_preceding_simple: the number of non-variadic groups preceding the current group. n_preceding_variadic: the number of variadic groups preceding the current group.
- mlir.dialects._ods_common.get_default_loc_context(location=None)¶
Returns a context in which the defaulted location is created. If the location is None, takes the current location from the stack.
- mlir.dialects._ods_common.get_op_result_or_value(arg: mlir._mlir_libs._mlir.ir.OpView | mlir._mlir_libs._mlir.ir.Operation | mlir._mlir_libs._mlir.ir.Value | mlir._mlir_libs._mlir.ir.OpResultList) mlir._mlir_libs._mlir.ir.Value¶
Returns the given value or the single result of the given op.
This is useful to implement op constructors so that they can take other ops as arguments instead of requiring the caller to extract results for every op. Raises ValueError if provided with an op that doesn’t have a single result.
- mlir.dialects._ods_common.get_op_results_or_values(arg: mlir._mlir_libs._mlir.ir.OpView | mlir._mlir_libs._mlir.ir.Operation | Sequence[mlir._mlir_libs._mlir.ir.OpView | mlir._mlir_libs._mlir.ir.Operation | mlir._mlir_libs._mlir.ir.Value]) Sequence[mlir._mlir_libs._mlir.ir.OpView | mlir._mlir_libs._mlir.ir.Operation | mlir._mlir_libs._mlir.ir.Value] | mlir._mlir_libs._mlir.ir.OpResultList¶
Returns the given sequence of values or the results of the given op.
This is useful to implement op constructors so that they can take other ops as lists of arguments instead of requiring the caller to extract results for every op.
- mlir.dialects._ods_common.get_op_result_or_op_results(op: mlir._mlir_libs._mlir.ir.OpView | mlir._mlir_libs._mlir.ir.Operation) mlir._mlir_libs._mlir.ir.Operation | mlir._mlir_libs._mlir.ir.OpResult | Sequence[mlir._mlir_libs._mlir.ir.OpResult]¶