def get_ix_slices_values_without_nan(): """ Gets the indexed slice values without NaN """ ix_slice_values_without_nans = tf.where(gen_math_ops.is_finite(input_tensor.values), input_tensor.values, gen_array_ops.zeros_like(input_tensor.values)) print_op = logging_ops.print_v2('WARNING - Tensor %s has NaN or Inf values. %s' % (input_tensor.name, name or '')) with ops.control_dependencies([ix_slice_values_without_nans, print_op]): return array_ops.identity(ix_slice_values_without_nans)
def _test_zeros_like(data): """ One iteration of ZEROS LIKE """ with tf.Graph().as_default(): in_data = array_ops.placeholder(shape=data.shape, dtype=data.dtype) out = gen_array_ops.zeros_like(in_data) compare_tflite_with_tvm(data, 'Placeholder:0', [in_data], [out])