Class TensorIsCloseTo<S>

  • Type Parameters:
    S - the s
    All Implemented Interfaces:
    org.hamcrest.Matcher<Tensor<S>>, org.hamcrest.SelfDescribing

    public class TensorIsCloseTo<S>
    extends org.hamcrest.TypeSafeDiagnosingMatcher<Tensor<S>>
    A hamcrest matcher for base tests, that matches a values of a tensor to be within a certain tolerance compared to the values of a reference (expected) tensor. Further, the shapes of the two tensors have to be equal (conform with the Shape.equals(Object) method).
    See Also:
    Shape, Field
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void describeTo​(org.hamcrest.Description description)  
      protected boolean matchesSafely​(Tensor<S> valueToAssert, org.hamcrest.Description mismatchDescription)  
      • Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher

        describeMismatch, matches
      • Methods inherited from class org.hamcrest.BaseMatcher

        _dont_implement_Matcher___instead_extend_BaseMatcher_, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TensorIsCloseTo

        public TensorIsCloseTo​(TensorSupport<S> tensoricSupport,
                               Tensor<S> value,
                               S tolerance)
    • Method Detail

      • describeTo

        public void describeTo​(org.hamcrest.Description description)
      • matchesSafely

        protected boolean matchesSafely​(Tensor<S> valueToAssert,
                                        org.hamcrest.Description mismatchDescription)
        Specified by:
        matchesSafely in class org.hamcrest.TypeSafeDiagnosingMatcher<Tensor<S>>