Skip to content

Commit

Permalink
feat: add linear layer to lstm network
Browse files Browse the repository at this point in the history
BREAKING CHANGES
  • Loading branch information
glencoe committed Mar 14, 2023
1 parent 48982f0 commit bccb50c
Show file tree
Hide file tree
Showing 64 changed files with 922 additions and 3,211 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- id: no-commit-to-branch
stages: [ commit, manual ]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.1
rev: v1.1.1
hooks:
- id: mypy
stages: [ manual ]
Expand Down
Empty file.
166 changes: 0 additions & 166 deletions elasticai/creator/examples/train_fp_lstm_on_sine.py

This file was deleted.

43 changes: 0 additions & 43 deletions elasticai/creator/examples/translate_lstm.py

This file was deleted.

3 changes: 0 additions & 3 deletions elasticai/creator/nn/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:

return self.ops.matmul(x, weight.T)

def quantized_forward(self, x: torch.Tensor) -> torch.Tensor:
raise NotImplementedError("The quantized_forward function is not implemented.")


@dataclass
class FixedPointConfig:
Expand Down
29 changes: 29 additions & 0 deletions elasticai/creator/on_disk_path.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os
from pathlib import Path as _PyPath
from typing import Iterable, Optional

from elasticai.creator.hdl.translatable import File, Path


class OnDiskFile(File):
def __init__(self, full_path: str):
self._full_path = full_path

def write_text(self, text: Iterable[str]) -> None:
full_path = _PyPath(self._full_path)
folder = full_path.parent
if not folder.exists():
os.makedirs(folder)
with open(full_path, "w") as f:
f.writelines((f"{line}\n" for line in text))


class OnDiskPath(Path):
def __init__(self, name: str, parent: str = "."):
self._full_path = f"{parent}/{name}"

def create_subpath(self, name: str) -> "Path":
return OnDiskPath(name, parent=self._full_path)

def as_file(self, suffix: str) -> "File":
return OnDiskFile(full_path=f"{self._full_path}{suffix}")
Empty file.
Empty file.
Empty file.

This file was deleted.

71 changes: 0 additions & 71 deletions elasticai/creator/tests/integration/test_jit.py

This file was deleted.

Empty file.
Loading

0 comments on commit bccb50c

Please sign in to comment.