Skip to content

Commit

Permalink
Remove unused numba dispatch function
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoV94 committed Jan 3, 2025
1 parent 8cc489b commit 8f07714
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions pytensor/link/numba/dispatch/elemwise.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
from collections.abc import Callable
from functools import singledispatch
from textwrap import dedent, indent
from typing import Any

import numba
import numpy as np
from numba.core.extending import overload
from numpy.core.numeric import normalize_axis_index, normalize_axis_tuple

from pytensor import config
from pytensor.graph.basic import Apply
from pytensor.graph.op import Op
from pytensor.link.numba.dispatch import basic as numba_basic
from pytensor.link.numba.dispatch.basic import (
Expand Down Expand Up @@ -124,42 +121,6 @@ def scalar_in_place_fn_ScalarMinimum(op, idx, res, arr):
"""


def create_vectorize_func(
scalar_op_fn: Callable,
node: Apply,
use_signature: bool = False,
identity: Any | None = None,
**kwargs,
) -> Callable:
r"""Create a vectorized Numba function from a `Apply`\s Python function."""

if len(node.outputs) > 1:
raise NotImplementedError(
"Multi-output Elemwise Ops are not supported by the Numba backend"
)

if use_signature:
signature = [create_numba_signature(node, force_scalar=True)]
else:
signature = []

target = (
getattr(node.tag, "numba__vectorize_target", None)
or config.numba__vectorize_target
)

numba_vectorized_fn = numba_basic.numba_vectorize(
signature, identity=identity, target=target, fastmath=config.numba__fastmath
)

py_scalar_func = getattr(scalar_op_fn, "py_func", scalar_op_fn)

elemwise_fn = numba_vectorized_fn(scalar_op_fn)
elemwise_fn.py_scalar_func = py_scalar_func

return elemwise_fn


def create_multiaxis_reducer(
scalar_op,
identity,
Expand Down

0 comments on commit 8f07714

Please sign in to comment.