Warning
You are reading a version of the website built against the unstable main branch. This content is liable to change without notice and may be inappropriate for your use case.
You can find the documentation for the current stable release here.
pyop3.expr package¶
Subpackages¶
- pyop3.expr.tensor package
- Submodules
- pyop3.expr.tensor.base module
CallableTensorTransformIdentityTensorTransformOutOfPlaceCallableTensorTransformReshapeTensorTransformTensorTensor.DEFAULT_PREFIXTensor.__getitem__()Tensor.assemble()Tensor.assign()Tensor.axis_treesTensor.commTensor.concretize()Tensor.copy()Tensor.dataTensor.data_roTensor.data_rwTensor.data_woTensor.dimTensor.dtypeTensor.duplicate()Tensor.getitem()Tensor.iassign()Tensor.sizeTensor.transformTensor.with_axis_trees()Tensor.with_context()Tensor.zero()
TensorTransform
- pyop3.expr.tensor.dat module
AggregateDatAggregateDat.DEFAULT_PREFIXAggregateDat.assign()AggregateDat.axesAggregateDat.axisAggregateDat.commAggregateDat.dtypeAggregateDat.get_instruction_executor_cache_key()AggregateDat.iassign()AggregateDat.materialize()AggregateDat.nameAggregateDat.record_new()AggregateDat.sizeAggregateDat.subdatsAggregateDat.subtensorsAggregateDat.with_context()
AxisMismatchExceptionCompositeDatDatDat.DEFAULT_PREFIXDat.__getitem__()Dat.as_array()Dat.as_vec()Dat.axesDat.axis_treesDat.axpy()Dat.bufferDat.commDat.concretize()Dat.context_freeDat.dat_versionDat.data_ro_with_halosDat.data_rw_with_halosDat.data_with_halosDat.data_wo_with_halosDat.dimDat.dtypeDat.duplicate()Dat.empty()Dat.empty_like()Dat.from_array()Dat.from_sequence()Dat.full()Dat.get_instruction_executor_cache_key()Dat.get_value()Dat.getitem()Dat.global_dataDat.inner()Dat.local_maxDat.local_minDat.localize()Dat.materialize()Dat.maxDat.maxpy()Dat.minDat.nameDat.nbytesDat.normDat.null()Dat.null_like()Dat.record_new()Dat.reshape()Dat.set_value()Dat.sfDat.sizeDat.transformDat.vecDat.vec_roDat.vec_rwDat.vec_woDat.with_axes()Dat.with_axis_trees()Dat.zeros()Dat.zeros_like()
IncompatibleShapeError
- pyop3.expr.tensor.mat module
AggregateMatAggregateMat.DEFAULT_PREFIXAggregateMat.assign()AggregateMat.column_axesAggregateMat.column_axisAggregateMat.commAggregateMat.dtypeAggregateMat.get_instruction_executor_cache_key()AggregateMat.iassign()AggregateMat.materialize()AggregateMat.nameAggregateMat.record_new()AggregateMat.row_axesAggregateMat.row_axisAggregateMat.submatsAggregateMat.subtensorsAggregateMat.with_context()
MatMat.DEFAULT_MAT_INIT_BUFFER_SPECMat.DEFAULT_PREFIXMat.as_array()Mat.axis_treesMat.bufferMat.column_axesMat.commMat.dimMat.dtypeMat.empty()Mat.from_sparsity()Mat.get_instruction_executor_cache_key()Mat.getitem()Mat.handleMat.local_maxMat.local_minMat.materialize()Mat.nameMat.ncolsMat.nest_indicesMat.nrowsMat.null()Mat.null_like()Mat.record_new()Mat.reshape()Mat.row_axesMat.sizeMat.sparsity()Mat.transformMat.valuesMat.with_axes()Mat.with_axis_trees()
make_full_mat_buffer_spec()
- pyop3.expr.tensor.scalar module
ScalarScalar.DEFAULT_DTYPEScalar.DEFAULT_PREFIXScalar.as_array()Scalar.axis_treesScalar.bufferScalar.commScalar.concretize()Scalar.constantScalar.copy()Scalar.dimScalar.get_instruction_executor_cache_key()Scalar.getitem()Scalar.local_maxScalar.local_minScalar.loop_axesScalar.nameScalar.record_new()Scalar.shapeScalar.sizeScalar.transformScalar.valueScalar.with_axis_trees()
- Module contents
- pyop3.expr.visitors package
- Submodules
- pyop3.expr.visitors.base module
- pyop3.expr.visitors.evaluate_arraywise module
- Module contents
ArgumentCollectorExpressionLinearizerExpressionVisitorcollect_arguments()collect_axis_vars()collect_loop_index_vars()estimate()evaluate()expand_transforms()find_max_value()find_min_value()get_extremum()get_local_max()get_local_min()get_loop_axes()get_shape()linearize_expr()materialize_composite_dat()max_()min_()replace_terminals()restrict_to_context()
Submodules¶
pyop3.expr.base module¶
- class pyop3.expr.base.Abs(a)[source]¶
Bases:
UnaryOperator- property local_max¶
- property local_min¶
- property symbol¶
- class pyop3.expr.base.Add(a, b)[source]¶
Bases:
BinaryOperator- property local_max¶
- property local_min¶
- class pyop3.expr.base.AxisVar(axis)[source]¶
Bases:
TerminalExpressionAxisVar(axis: ‘pyop3.axis_tree.Axis’)
- axis¶
- property dtype¶
- get_instruction_executor_cache_key(visitor)¶
- property local_max¶
- property local_min¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
- class pyop3.expr.base.BinaryOperator(a, b)[source]¶
Bases:
OperatorBinaryOperator(a: ‘ExpressionT’, b: ‘ExpressionT’)
- a¶
- b¶
- child_attrs = ('a', 'b')¶
- property dtype¶
- get_instruction_executor_cache_key(visitor)¶
- property operands¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
- class pyop3.expr.base.Comparison(a, b)[source]¶
Bases:
BinaryOperator- property local_max¶
- property local_min¶
- class pyop3.expr.base.Conditional(a, b, c)[source]¶
Bases:
TernaryOperatorConditional(a: ‘ExpressionT’, b: ‘ExpressionT’, c: ‘ExpressionT’)
- property if_false¶
- property if_true¶
- property local_max¶
- property local_min¶
- property predicate¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
- class pyop3.expr.base.Div(a, b)[source]¶
Bases:
BinaryOperator
- class pyop3.expr.base.FloorDiv(a, b)[source]¶
Bases:
BinaryOperator
- class pyop3.expr.base.GreaterThan(a, b)[source]¶
Bases:
Comparison
- class pyop3.expr.base.GreaterThanOrEqual(a, b)[source]¶
Bases:
Comparison
- class pyop3.expr.base.LessThan(a, b)[source]¶
Bases:
Comparison
- class pyop3.expr.base.LessThanOrEqual(a, b)[source]¶
Bases:
Comparison
- class pyop3.expr.base.LoopIndexVar(loop_index, axis)[source]¶
Bases:
TerminalExpressionLoopIndexVar(loop_index, axis) -> ‘None’
- axis¶
- property dtype¶
- get_instruction_executor_cache_key(visitor)¶
- property local_max¶
- property local_min¶
- loop_index¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
- class pyop3.expr.base.Modulo(a, b)[source]¶
Bases:
BinaryOperator
- class pyop3.expr.base.Mul(a, b)[source]¶
Bases:
BinaryOperator- property local_max¶
- property local_min¶
- class pyop3.expr.base.NaN[source]¶
Bases:
TerminalExpressionNaN()
- property dtype¶
- get_instruction_executor_cache_key(visitor)¶
- property local_max¶
- property local_min¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
- class pyop3.expr.base.NameVar(name)[source]¶
Bases:
TerminalExpressionClass for representing arbitrary variables.
They are useful for evaluating arbitrary symbolic expressions where something like an \(AxisVar\) would be inappropriate (due to there not being an axis available).
- name¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
- class pyop3.expr.base.NamedTerminalExpression[source]¶
Bases:
TerminalExpressionA terminal with a name.
This type is important because only named terminals can be replaced when an operation is reused. For example we can only do the following:
loop = op3.loop(p, kernel(dat1[p])) loop(**{"dat": dat2}) # pass dat2 instead of dat1
if
dat1is a named terminal.
- class pyop3.expr.base.Neg(a)[source]¶
Bases:
UnaryOperator- property local_max¶
- property local_min¶
- property symbol¶
- class pyop3.expr.base.Operator[source]¶
Bases:
Expression- abstract property operands¶
- class pyop3.expr.base.Or(a, b)[source]¶
Bases:
Comparison
- class pyop3.expr.base.Pow(a, b)[source]¶
Bases:
BinaryOperator- property local_max¶
- property local_min¶
- class pyop3.expr.base.Sub(a, b)[source]¶
Bases:
BinaryOperator- property local_max¶
- property local_min¶
- class pyop3.expr.base.TerminalExpression[source]¶
Bases:
Expression,Terminal,ABC- child_attrs = ()¶
- class pyop3.expr.base.TernaryOperator(a, b, c)[source]¶
Bases:
OperatorTernaryOperator(a: ‘ExpressionT’, b: ‘ExpressionT’, c: ‘ExpressionT’)
- a¶
- b¶
- c¶
- child_attrs = ('a', 'b', 'c')¶
- property dtype¶
- get_instruction_executor_cache_key(visitor)¶
- property operands¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
- class pyop3.expr.base.UnaryOperator(a)[source]¶
Bases:
OperatorUnaryOperator(a: ‘ExpressionT’)
- a¶
- child_attrs = ('a',)¶
- property dtype¶
- get_instruction_executor_cache_key(visitor)¶
- property operand¶
- property operands¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
- abstract property symbol¶
pyop3.expr.buffer module¶
- class pyop3.expr.buffer.BufferExpression[source]¶
Bases:
Expression- property buffer¶
- property dtype¶
- property name¶
- class pyop3.expr.buffer.DatBufferExpression[source]¶
Bases:
BufferExpression
- class pyop3.expr.buffer.LinearBufferExpression[source]¶
Bases:
BufferExpression
- class pyop3.expr.buffer.LinearDatBufferExpression(buffer_view, layout)[source]¶
Bases:
DatBufferExpression,LinearBufferExpressionA dat with fixed (?) layout.
It cannot be indexed.
This class is useful for describing arrays used in index expressions, at which point it has a fixed set of axes.
- buffer_view¶
- child_attrs = ('layout',)¶
- property comm¶
- layout¶
- property local_max¶
- property local_min¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
- class pyop3.expr.buffer.MatArrayBufferExpression(buffer_view, row_layouts, column_layouts)[source]¶
Bases:
MatBufferExpression,NonlinearBufferExpressionMatArrayBufferExpression(buffer_view, row_layouts, column_layouts)
- buffer_view¶
- child_attrs = ('row_layouts', 'column_layouts')¶
- column_layouts¶
- property local_max¶
- property local_min¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
- row_layouts¶
- class pyop3.expr.buffer.MatBufferExpression[source]¶
Bases:
BufferExpression
- class pyop3.expr.buffer.MatPetscMatBufferExpression(buffer_view, row_layout, column_layout)[source]¶
Bases:
MatBufferExpression,LinearBufferExpressionMatPetscMatBufferExpression(buffer_view: ‘pyop3.buffer.IndexedBuffer’, row_layout: ‘ExpressionT’, column_layout: ‘ExpressionT’)
- buffer_view¶
- child_attrs = ('row_layout', 'column_layout')¶
- column_layout¶
- property local_max¶
- property local_min¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
- row_layout¶
- class pyop3.expr.buffer.NonlinearBufferExpression[source]¶
Bases:
BufferExpression
- class pyop3.expr.buffer.NonlinearDatBufferExpression(buffer_view, layouts)[source]¶
Bases:
DatBufferExpression,NonlinearBufferExpressionA dat with fixed layouts.
This class is useful for describing dats whose layouts have been optimised.
- buffer_view¶
- child_attrs = ('layouts',)¶
- property comm¶
- layouts¶
- property leaf_layouts¶
- property local_max¶
- property local_min¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
- class pyop3.expr.buffer.ScalarBufferExpression(buffer_view)[source]¶
Bases:
BufferExpressionScalarBufferExpression(buffer_view: ‘AbstractBuffer | pyop3.buffer.IndexedBuffer’) -> ‘None’
- buffer_view¶
- child_attrs = ()¶
- get_instruction_executor_cache_key(visitor)¶
- property local_max¶
- property local_min¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
- property value¶
pyop3.expr.opaque module¶
- class pyop3.expr.opaque.OpaqueTerminal(buffer_view, *, name=None, prefix=None)[source]¶
Bases:
NamedTerminalExpressionA data object that we don’t know anything about but the local kernel does.
This class is useful for blindly passing arguments into local kernels without doing any packing/unpacking.
- DEFAULT_PREFIX = 'opaque'¶
- property buffer¶
- buffer_view¶
- property comm¶
- get_instruction_executor_cache_key(visitor)¶
- name¶
- nest_indices = ()¶
- record_new(**attrs)¶
Create and initialise a new record from an existing one.
