提交 fb6b8625 authored 作者: Brandon T. Willard's avatar Brandon T. Willard

Rename theano.link.c.cc to theano.link.c.basic

上级 900d752c
...@@ -26,7 +26,7 @@ from theano.gpuarray.elemwise import ( ...@@ -26,7 +26,7 @@ from theano.gpuarray.elemwise import (
) )
from theano.gpuarray.type import GpuArrayType, get_context, gpuarray_shared_constructor from theano.gpuarray.type import GpuArrayType, get_context, gpuarray_shared_constructor
from theano.link.basic import PerformLinker from theano.link.basic import PerformLinker
from theano.link.c.cc import CLinker from theano.link.c.basic import CLinker
# This is actually a test for GpuElemwise # This is actually a test for GpuElemwise
......
...@@ -7,7 +7,7 @@ from theano.gof.graph import Apply, Constant, Variable ...@@ -7,7 +7,7 @@ from theano.gof.graph import Apply, Constant, Variable
from theano.gof.op import Op from theano.gof.op import Op
from theano.gof.type import Type from theano.gof.type import Type
from theano.link.basic import PerformLinker from theano.link.basic import PerformLinker
from theano.link.c.cc import CLinker, DualLinker, OpWiseCLinker from theano.link.c.basic import CLinker, DualLinker, OpWiseCLinker
def as_variable(x): def as_variable(x):
......
...@@ -128,7 +128,7 @@ def test_speed(): ...@@ -128,7 +128,7 @@ def test_speed():
print(f"{name} takes {1000 * (t_b - t_a) / (steps_b - steps_a):f} s/Kop") print(f"{name} takes {1000 * (t_b - t_a) / (steps_b - steps_a):f} s/Kop")
from theano.link.c.cc import OpWiseCLinker from theano.link.c.basic import OpWiseCLinker
time_linker("c|py", OpWiseCLinker) time_linker("c|py", OpWiseCLinker)
time_linker("vmLinker", VMLinker) time_linker("vmLinker", VMLinker)
......
...@@ -249,7 +249,7 @@ class RecordMode(Mode): ...@@ -249,7 +249,7 @@ class RecordMode(Mode):
line = f"Outputs: {outputs_digest}\n" line = f"Outputs: {outputs_digest}\n"
handle_line(fgraph, line, i, node, fn) handle_line(fgraph, line, i, node, fn)
# linker = theano.link.c.cc.OpWiseCLinker() # linker = theano.link.c.basic.OpWiseCLinker()
linker = VMLinker(use_cloop=bool(config.cxx)) linker = VMLinker(use_cloop=bool(config.cxx))
wrap_linker = WrapLinkerMany([linker], [callback]) wrap_linker = WrapLinkerMany([linker], [callback])
......
...@@ -14,7 +14,7 @@ import pytest ...@@ -14,7 +14,7 @@ import pytest
import tests.unittest_tools as utt import tests.unittest_tools as utt
import theano import theano
from theano.gof import FunctionGraph from theano.gof import FunctionGraph
from theano.link.c.cc import DualLinker from theano.link.c.basic import DualLinker
from theano.scalar.basic import ( from theano.scalar.basic import (
ComplexError, ComplexError,
Composite, Composite,
......
...@@ -20,7 +20,7 @@ def test_SymPyCCode(): ...@@ -20,7 +20,7 @@ def test_SymPyCCode():
op = SymPyCCode([xs, ys], xs + ys) op = SymPyCCode([xs, ys], xs + ys)
e = op(xt, yt) e = op(xt, yt)
g = theano.gof.FunctionGraph([xt, yt], [e]) g = theano.gof.FunctionGraph([xt, yt], [e])
fn = theano.link.c.cc.CLinker().accept(g).make_function() fn = theano.link.c.basic.CLinker().accept(g).make_function()
assert fn(1.0, 2.0) == 3.0 assert fn(1.0, 2.0) == 3.0
......
...@@ -16,7 +16,7 @@ def test_view_op_c_code(): ...@@ -16,7 +16,7 @@ def test_view_op_c_code():
# TODO: It might be good to make sure that the registered C code works # TODO: It might be good to make sure that the registered C code works
# (even though it's basically copy-paste from other registered `Op`s). # (even though it's basically copy-paste from other registered `Op`s).
# from theano.compile.ops import view_op # from theano.compile.ops import view_op
# from theano.link.c.cc import CLinker # from theano.link.c.basic import CLinker
# rng_var = random_state_type() # rng_var = random_state_type()
# rng_view = view_op(rng_var) # rng_view = view_op(rng_var)
# function( # function(
......
...@@ -72,7 +72,7 @@ from theano import compile, config, function, gof, shared ...@@ -72,7 +72,7 @@ from theano import compile, config, function, gof, shared
from theano.compile import DeepCopyOp from theano.compile import DeepCopyOp
from theano.compile.mode import get_default_mode from theano.compile.mode import get_default_mode
from theano.gof.graph import Variable from theano.gof.graph import Variable
from theano.link.c.cc import DualLinker from theano.link.c.basic import DualLinker
from theano.scalar import autocast_float, autocast_float_as from theano.scalar import autocast_float, autocast_float_as
from theano.tensor import ( from theano.tensor import (
Alloc, Alloc,
......
...@@ -12,7 +12,7 @@ from tests import unittest_tools ...@@ -12,7 +12,7 @@ from tests import unittest_tools
from theano import config, gof, scalar from theano import config, gof, scalar
from theano.compile.mode import Mode, get_default_mode from theano.compile.mode import Mode, get_default_mode
from theano.link.basic import PerformLinker from theano.link.basic import PerformLinker
from theano.link.c.cc import CLinker, OpWiseCLinker from theano.link.c.basic import CLinker, OpWiseCLinker
from theano.tensor import TensorType, as_tensor_variable from theano.tensor import TensorType, as_tensor_variable
from theano.tensor.elemwise import ( from theano.tensor.elemwise import (
CAReduce, CAReduce,
......
...@@ -115,7 +115,7 @@ from theano.gof import ( ...@@ -115,7 +115,7 @@ from theano.gof import (
) )
from theano.gradient import Lop, Rop, grad, subgraph_grad from theano.gradient import Lop, Rop, grad, subgraph_grad
from theano.link.basic import Container, Linker, LocalLinker, PerformLinker from theano.link.basic import Container, Linker, LocalLinker, PerformLinker
from theano.link.c.cc import CLinker, DualLinker, OpWiseCLinker from theano.link.c.basic import CLinker, DualLinker, OpWiseCLinker
from theano.misc.safe_asarray import _asarray from theano.misc.safe_asarray import _asarray
from theano.printing import pp, pprint from theano.printing import pp, pprint
from theano.updates import OrderedUpdates from theano.updates import OrderedUpdates
......
...@@ -1536,7 +1536,7 @@ class FunctionMaker: ...@@ -1536,7 +1536,7 @@ class FunctionMaker:
# too much execution time during testing as we compile # too much execution time during testing as we compile
# much more functions then the number of compile c # much more functions then the number of compile c
# module. # module.
theano.link.c.cc.get_module_cache().refresh() theano.link.c.basic.get_module_cache().refresh()
# Handle the case where inputs and/or outputs is a single # Handle the case where inputs and/or outputs is a single
# Variable (not in a list) # Variable (not in a list)
unpack_single = False unpack_single = False
......
...@@ -10,7 +10,7 @@ import theano ...@@ -10,7 +10,7 @@ import theano
from theano import config, gof from theano import config, gof
from theano.compile.function.types import Supervisor from theano.compile.function.types import Supervisor
from theano.link.basic import PerformLinker from theano.link.basic import PerformLinker
from theano.link.c.cc import CLinker, OpWiseCLinker from theano.link.c.basic import CLinker, OpWiseCLinker
from theano.link.jax import JAXLinker from theano.link.jax import JAXLinker
from theano.link.vm import VMLinker from theano.link.vm import VMLinker
......
...@@ -5,7 +5,7 @@ import numpy as np ...@@ -5,7 +5,7 @@ import numpy as np
from theano.compile.mode import Mode from theano.compile.mode import Mode
from theano.configdefaults import config from theano.configdefaults import config
from theano.link.basic import WrapLinkerMany from theano.link.basic import WrapLinkerMany
from theano.link.c.cc import OpWiseCLinker from theano.link.c.basic import OpWiseCLinker
class MonitorMode(Mode): class MonitorMode(Mode):
......
...@@ -843,7 +843,7 @@ class Op(object2, PureOp, CLinkerOp): ...@@ -843,7 +843,7 @@ class Op(object2, PureOp, CLinkerOp):
# FIXME: Putting the following import on the module level causes an import cycle. # FIXME: Putting the following import on the module level causes an import cycle.
# The conclusion should be that the antire "make_c_thunk" method should be defined # The conclusion should be that the antire "make_c_thunk" method should be defined
# in theano.link.c and dispatched onto the Op! # in theano.link.c and dispatched onto the Op!
import theano.link.c.cc import theano.link.c.basic
node_input_storage = [storage_map[r] for r in node.inputs] node_input_storage = [storage_map[r] for r in node.inputs]
node_output_storage = [storage_map[r] for r in node.outputs] node_output_storage = [storage_map[r] for r in node.outputs]
...@@ -854,7 +854,7 @@ class Op(object2, PureOp, CLinkerOp): ...@@ -854,7 +854,7 @@ class Op(object2, PureOp, CLinkerOp):
for (new_o, old_o) in zip(e.outputs, node.outputs) for (new_o, old_o) in zip(e.outputs, node.outputs)
if old_o in no_recycling if old_o in no_recycling
] ]
cl = theano.link.c.cc.CLinker().accept(e, no_recycling=e_no_recycling) cl = theano.link.c.basic.CLinker().accept(e, no_recycling=e_no_recycling)
# float16 gets special treatment since running # float16 gets special treatment since running
# unprepared C code will get bad results. # unprepared C code will get bad results.
if not getattr(self, "_f16_ok", False): if not getattr(self, "_f16_ok", False):
......
...@@ -11,7 +11,7 @@ from theano.gof import COp, ParamsType ...@@ -11,7 +11,7 @@ from theano.gof import COp, ParamsType
from theano.gof.opt import copy_stack_trace from theano.gof.opt import copy_stack_trace
from theano.gof.utils import MethodNotDefined from theano.gof.utils import MethodNotDefined
from theano.gradient import grad_undefined from theano.gradient import grad_undefined
from theano.link.c.cc import HideC from theano.link.c.basic import HideC
from theano.scalar import bool as bool_t from theano.scalar import bool as bool_t
from theano.scalar import int32 as int32_t from theano.scalar import int32 as int32_t
from theano.tensor.basic import Alloc, AllocEmpty, Join, Split, alloc_validate_shape from theano.tensor.basic import Alloc, AllocEmpty, Join, Split, alloc_validate_shape
......
...@@ -150,7 +150,7 @@ from theano.gpuarray.type import ( ...@@ -150,7 +150,7 @@ from theano.gpuarray.type import (
move_to_gpu, move_to_gpu,
) )
from theano.ifelse import IfElse from theano.ifelse import IfElse
from theano.link.c.cc import CLinker from theano.link.c.basic import CLinker
from theano.misc.ordered_set import OrderedSet from theano.misc.ordered_set import OrderedSet
from theano.scalar.basic import Cast, Pow, Scalar, log, neg, true_div from theano.scalar.basic import Cast, Pow, Scalar, log, neg, true_div
from theano.scalar.basic_scipy import Erfcinv, Erfinv from theano.scalar.basic_scipy import Erfcinv, Erfinv
......
...@@ -27,7 +27,7 @@ from theano.link.c.cmodule import get_module_cache as _get_module_cache ...@@ -27,7 +27,7 @@ from theano.link.c.cmodule import get_module_cache as _get_module_cache
from theano.link.utils import gc_helper, map_storage, raise_with_op, streamline from theano.link.utils import gc_helper, map_storage, raise_with_op, streamline
_logger = logging.getLogger("theano.link.c.cc") _logger = logging.getLogger("theano.link.c.basic")
run_cthunk = None # Will be imported only when needed. run_cthunk = None # Will be imported only when needed.
......
...@@ -63,7 +63,7 @@ from theano.gof import Apply, PureOp ...@@ -63,7 +63,7 @@ from theano.gof import Apply, PureOp
from theano.gof.graph import equal_computations, io_connection_pattern from theano.gof.graph import equal_computations, io_connection_pattern
from theano.gof.toolbox import NoOutputFromInplace from theano.gof.toolbox import NoOutputFromInplace
from theano.gradient import DisconnectedType, NullType, grad_undefined from theano.gradient import DisconnectedType, NullType, grad_undefined
from theano.link.c.cc import CLinker from theano.link.c.basic import CLinker
from theano.link.c.exceptions import MissingGXX from theano.link.c.exceptions import MissingGXX
from theano.link.utils import raise_with_op from theano.link.utils import raise_with_op
from theano.scan.utils import Validator, forced_replace, hash_listsDictsTuples, safe_new from theano.scan.utils import Validator, forced_replace, hash_listsDictsTuples, safe_new
......
...@@ -1037,7 +1037,7 @@ second dimension ...@@ -1037,7 +1037,7 @@ second dimension
if self.openmp: if self.openmp:
# If we are using openmp, we need to get rid of the "goto" # If we are using openmp, we need to get rid of the "goto"
# statement in sub['fail']. For now we recreate it here. # statement in sub['fail']. For now we recreate it here.
fail = theano.link.c.cc.failure_code(sub, use_goto=False) fail = theano.link.c.basic.failure_code(sub, use_goto=False)
else: else:
fail = sub["fail"] fail = sub["fail"]
task_code = self.scalar_op.c_code( task_code = self.scalar_op.c_code(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论