Ejemplo n.º 1
0
  def testEmpty(self):
    for s in self.all_shapes:
      actual = np_array_ops.empty(s)
      expected = np.empty(s)
      msg = 'shape: {}'.format(s)
      self.match_shape(actual, expected, msg)
      self.match_dtype(actual, expected, msg)

    for s, t in itertools.product(self.all_shapes, self.all_types):
      actual = np_array_ops.empty(s, t)
      expected = np.empty(s, t)
      msg = 'shape: {}, dtype: {}'.format(s, t)
      self.match_shape(actual, expected, msg)
      self.match_dtype(actual, expected, msg)
Ejemplo n.º 2
0
 def testIx_(self):
   possible_arys = [[True, True], [True, False], [False, False],
                    list(range(5)), np_array_ops.empty(0, dtype=np.int64)]
   for r in range(len(possible_arys)):
     for arys in itertools.combinations_with_replacement(possible_arys, r):
       tnp_ans = np_array_ops.ix_(*arys)
       onp_ans = np.ix_(*arys)
       for t, o in zip(tnp_ans, onp_ans):
         self.match(t, o)