Skip to content

Commit

Permalink
Import MockTensor
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinfriede committed Mar 21, 2024
1 parent 47e2e6d commit ed53935
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions test/test_model/test_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import pytest
import torch
from tad_mctc.convert import str_to_device
from tad_mctc.typing import MockTensor

from tad_dftd3 import reference
from tad_dftd3.typing import DD, Any, Tensor, TypedDict
Expand Down Expand Up @@ -69,16 +70,6 @@ def test_reference_device(device_str: str, device_str2: str) -> None:


def test_reference_different_devices() -> None:
# Custom Tensor class with overridable device property
class MockTensor(Tensor):
@property
def device(self) -> Any:
return self._device

@device.setter
def device(self, value: Any) -> None:
self._device = value

# Custom mock functions
def mock_load_cn(*_: Any, **__: Any) -> Tensor:
tensor = MockTensor([1, 2, 3])
Expand Down

0 comments on commit ed53935

Please sign in to comment.