Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
percevalw committed May 15, 2024
1 parent ff538d6 commit 722e4a8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions foldedtensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ def backward(ctx, grad_output):
return grad_input, None


def this_is_a_test():
print("ok")


type_to_dtype_dict = {
int: torch.tensor([0]).dtype,
float: torch.tensor([0.0]).dtype,
Expand Down
22 changes: 11 additions & 11 deletions tests/test_folded_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,14 +406,14 @@ def test_imbalanced_sequence_2():
assert "'int' object is not iterable" in str(e.value)


def test_max():
ft = as_folded_tensor(
[
[0, 1, 2],
[3, 4],
],
dtype=torch.float,
)
values, indices = ft.max(-1)
assert (values == torch.tensor([2, 4])).all()
assert (indices == torch.tensor([2, 1])).all()
# def test_max():
# ft = as_folded_tensor(
# [
# [0, 1, 2],
# [3, 4],
# ],
# dtype=torch.float,
# )
# values, indices = ft.max(-1)
# assert (values == torch.tensor([2, 4])).all()
# assert (indices == torch.tensor([2, 1])).all()

0 comments on commit 722e4a8

Please sign in to comment.