Beispiel #1
0
 def getTestCases(self):
     return {
         "pad_4d_2d": [
             base.Tensor([1, 2, 2, 1]),
             base.Tensor([4, 2], dtype=tf.int32, const_val=[0, 0, 1, 1, 1, 1, 0, 0])
         ]
     }
Beispiel #2
0
 def getTestCases(self):
     '''
     this returns a a hash containg test cases.
     key of return hash is test case name and
     value of return hash is test is a list of input tensor metadata.
     test name (key of hash) is used as
         - prefix of file name to be generated (don't use white space or special characters)
         - output node name pf graph
     '''
     return {"stack_4d": [base.Tensor([1, 4, 3]), base.Tensor([1, 4, 3])]}
Beispiel #3
0
    def getTestCases(self):
        '''
        this returns a hash of test case (= set of input type), for example:
            [1.2, -2.3] : two input, both are scalar. one is 1.2, another is -2.3
            [[5,3], [5,4,3]] : two input, both are shapes. one is [5.3], another is [5,4,3]

        test name (key of hash) is used as
            - prefix of file name to be generated
            - output node name pf graph
        '''
        return {
            "topk_2d": [
                base.Tensor(shape=[2, 3], dtype=tf.float32),
                base.Tensor(shape=[], const_val=2, dtype=tf.int32)
            ],
            "topk_3d": [
                base.Tensor(shape=[2, 3, 4], dtype=tf.float32),
                base.Tensor(shape=[], const_val=2, dtype=tf.int32)
            ],
        }
Beispiel #4
0
 def getTestCases(self):
     '''
     this returns a a hash containg test cases.
     key of return hash is test case name and
     value of return hash is test is a list of input tensor metadata.
     test name (key of hash) is used as
         - prefix of file name to be generated (don't use white space or special characters)
         - output node name pf graph
     '''
     # yapf: disable
     return {
         "div_scalarConst_scalarConst":
         [base.Tensor([], const_val=1.2),
          base.Tensor([], const_val=-2.3)],
         "div_1d_1d": [base.Tensor([5]), base.Tensor([5])],
         "div_2d_2d": [base.Tensor([5, 3]), base.Tensor([5, 3])],
         "div_3d_3d": [base.Tensor([5, 4, 3]),
                       base.Tensor([5, 4, 3])],
         "div_4d_4d": [base.Tensor([2, 5, 4, 3]),
                       base.Tensor([2, 5, 4, 3])],
         # broadcasting by scalar
         "div_1d_scalarConst": [base.Tensor([5]),
                                base.Tensor([], const_val=1.1)],
         "div_2d_scalarConst": [base.Tensor([5, 3]),
                                base.Tensor([], const_val=1.1)],
         "div_3d_scalarConst": [base.Tensor([5, 4, 3]),
                                base.Tensor([], const_val=1.1)],
         "div_4d_scalarConst": [base.Tensor([2, 5, 4, 3]),
                                base.Tensor([], const_val=1.1)],
         # broadcasting by 1d
         "div_2d_1d": [base.Tensor([5, 3]),
                       base.Tensor(   [3])],
         "div_3d_1d": [base.Tensor([5, 4, 3]),
                       base.Tensor(      [3])],
         "div_4d_1d": [base.Tensor([2, 5, 4, 3]),
                       base.Tensor(         [3])],
         # broadcasting by 2d
         "div_3d_2d": [base.Tensor([5, 4, 3]),
                       base.Tensor(   [4, 3])],
         "div_4d_2d": [base.Tensor([2, 5, 4, 3]),
                       base.Tensor(      [4, 3])],
         # broadcasting by 3d
         "div_4d_3d": [base.Tensor([2, 5, 4, 3]),
                       base.Tensor(   [5, 4, 3])]
     }
Beispiel #5
0
 def getTestCases(self):
     return {"floor_4d_4d": [base.Tensor([1, 2, 2, 1]), base.Tensor([1, 2, 2, 1])]}
Beispiel #6
0
 def getTestCases(self):
     return {"transpose_4d": [base.Tensor([1, 2, 2, 1])]}
Beispiel #7
0
 def getTestCases(self):
     return {"squeeze_3d": [base.Tensor([1, 5, 1])]}