compiled-knowledge 4.0.0a23__cp312-cp312-musllinux_1_2_x86_64.whl → 4.0.0a25__cp312-cp312-musllinux_1_2_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of compiled-knowledge might be problematic. Click here for more details.
- ck/circuit/_circuit_cy.c +1 -1
- ck/circuit/tmp_const.py +5 -4
- ck/circuit_compiler/circuit_compiler.py +3 -2
- ck/circuit_compiler/cython_vm_compiler/_compiler.c +152 -152
- ck/circuit_compiler/cython_vm_compiler/_compiler.cpython-312-x86_64-linux-musl.so +0 -0
- ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.c +1 -1
- ck/circuit_compiler/support/llvm_ir_function.py +4 -4
- ck/example/diamond_square.py +3 -1
- ck/example/triangle_square.py +3 -1
- ck/example/truss.py +3 -1
- ck/in_out/parse_net.py +21 -19
- ck/in_out/parser_utils.py +7 -3
- ck/pgm.py +146 -139
- ck/pgm_circuit/mpe_program.py +3 -4
- ck/pgm_circuit/pgm_circuit.py +27 -18
- ck/pgm_circuit/program_with_slotmap.py +4 -1
- ck/pgm_compiler/pgm_compiler.py +1 -1
- ck/pgm_compiler/support/circuit_table/_circuit_table_cy.c +1 -1
- ck/pgm_compiler/support/join_tree.py +3 -3
- ck/probability/empirical_probability_space.py +4 -3
- ck/probability/pgm_probability_space.py +7 -3
- ck/probability/probability_space.py +20 -15
- ck/program/raw_program.py +23 -16
- ck/sampling/sampler_support.py +7 -5
- ck/utils/iter_extras.py +3 -2
- ck/utils/local_config.py +16 -8
- {compiled_knowledge-4.0.0a23.dist-info → compiled_knowledge-4.0.0a25.dist-info}/METADATA +1 -1
- {compiled_knowledge-4.0.0a23.dist-info → compiled_knowledge-4.0.0a25.dist-info}/RECORD +31 -31
- {compiled_knowledge-4.0.0a23.dist-info → compiled_knowledge-4.0.0a25.dist-info}/WHEEL +0 -0
- {compiled_knowledge-4.0.0a23.dist-info → compiled_knowledge-4.0.0a25.dist-info}/licenses/LICENSE.txt +0 -0
- {compiled_knowledge-4.0.0a23.dist-info → compiled_knowledge-4.0.0a25.dist-info}/top_level.txt +0 -0
ck/circuit/_circuit_cy.c
CHANGED
ck/circuit/tmp_const.py
CHANGED
|
@@ -10,15 +10,16 @@ class TmpConst:
|
|
|
10
10
|
A TmpConst enables the consistent, temporary setting and clearing
|
|
11
11
|
of circuit variables to constant values.
|
|
12
12
|
|
|
13
|
-
Example usage
|
|
13
|
+
Example usage::
|
|
14
|
+
|
|
14
15
|
with TmpConst(my_circuit) as tmp:
|
|
15
16
|
tmp.set_const(0, 123.456)
|
|
16
17
|
tmp.set_const(my_list_of_vars, 110.99)
|
|
17
18
|
program = Program(my_top)
|
|
18
|
-
# now use
|
|
19
|
+
# now use `program`
|
|
19
20
|
|
|
20
|
-
Within the
|
|
21
|
-
the compiler can optimise. When the
|
|
21
|
+
Within the `with` section, circuit variables are set to const values, which
|
|
22
|
+
the compiler can optimise. When the `with` section exits, the variables
|
|
22
23
|
are restored to their original state.
|
|
23
24
|
"""
|
|
24
25
|
__slots__ = ('_circuit', '_undo')
|
|
@@ -13,12 +13,13 @@ class CircuitCompiler(Protocol):
|
|
|
13
13
|
circuit: Optional[Circuit] = None,
|
|
14
14
|
) -> RawProgram:
|
|
15
15
|
"""
|
|
16
|
-
A
|
|
16
|
+
A PGM compiler compiles selected results nodes of an arithmetic circuit to a program.
|
|
17
17
|
|
|
18
18
|
Args:
|
|
19
19
|
*result: one or more circuit of nodes defining the result of the program function.
|
|
20
20
|
All result node must be from the same circuit.
|
|
21
|
-
input_vars: how to determine the input variables.
|
|
21
|
+
input_vars: how to determine the input variables. Either a sequence of VarNodes, or a single
|
|
22
|
+
VarNode, or a `InferVars` member. The default is to use all circuit variables, in index order.
|
|
22
23
|
circuit: optionally explicitly specify the Circuit (mandatory if no result nodes are provided).
|
|
23
24
|
|
|
24
25
|
Returns:
|