Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ischweer committed Jan 21, 2025
1 parent 90880e2 commit 96ec531
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pytensor/link/pytorch/dispatch/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ def pytorch_typify_tensor(data, dtype=None, **kwargs):
def pytorch_typify_no_conversion_needed(data, **kwargs):
return data


@pytorch_typify.register(np.number)
def pytorch_typify_extract(data, **kwargs):
return data.item()


@singledispatch
def pytorch_funcify(op, node=None, storage_map=None, **kwargs):
"""Create a PyTorch compatible function from an PyTensor `Op`."""
Expand Down
1 change: 0 additions & 1 deletion pytensor/link/pytorch/linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class wrapper:
"""

def __init__(self, fn, gen_functors):
self._fn = fn
self.fn = torch.compile(fn)
self.gen_functors = gen_functors.copy()

Expand Down
4 changes: 1 addition & 3 deletions pytensor/link/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,9 +758,7 @@ def fgraph_to_python(
new_output_name = unique_name(i)
getter_unique_name = unique_name(getter_or_value)
global_env[getter_unique_name] = getter_or_value
assign_str = (
f"{new_output_name} = {getter_unique_name}()"
)
assign_str = f"{new_output_name} = {getter_unique_name}()"
body_assigns.append(assign_str)
node_input_names.append(new_output_name)
continue
Expand Down

0 comments on commit 96ec531

Please sign in to comment.