Conversation
…tensity Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
|
/build |
| result = flip(im) | ||
| if isinstance(result, torch.Tensor): | ||
| result = result.cpu() | ||
| self.assertTrue(np.allclose(expected, result)) |
There was a problem hiding this comment.
could you help change this to np.testing.assert_allclose(doc) it would give us more info when there are mismatches. also, as we are having more transform supporting both tensor and np.array, would be great to have a utility assert_allclose that can handle both types
|
/build |
|
/build |
|
thanks @wyli - will add the testing as the next PR. |
| data[str(key) + InverseKeys.KEY_SUFFIX].pop() | ||
|
|
||
| def inverse(self, data: dict) -> Dict[Hashable, np.ndarray]: | ||
| def inverse(self, data: dict) -> dict: |
There was a problem hiding this comment.
May I know why you change Dict annotation to dict?
Thanks.
There was a problem hiding this comment.
I needed to make it more general. Otherwise the derived classes can't return Dict[Hashable, NdarrayOrTensor]. I'm hoping to be able to put it back in once the transforms are done. For some reason I couldn't set the parent class (InvertibleTransform) to have Dict[Hashable, NdarrayOrTensor] and have the unmodified classes return Dict[Hashable, np.ndarray], even though this is a more-specific return type. So I had to settle for dict.
Description
Torch/Numpy Flip-based transforms.
Requires #2815 to be merged first.
Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests.