Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 39 for use_empty (0.25 sec)

  1. tensorflow/compiler/mlir/tensorflow/transforms/resource_op_lifting_cleanup.cc

    // results of the operation will be eliminated.
    void EliminateUnusedResults(
        Operation *op, const llvm::BitVector *results_to_eliminate = nullptr) {
      auto can_eliminate = [&](OpResult &result) -> bool {
        if (!result.use_empty()) return false;
        if (results_to_eliminate)
          return results_to_eliminate->test(result.getResultNumber());
        else
          return true;
      };
      SmallVector<Type, 4> new_result_types;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 19.7K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/transforms/reduce_while_operands.cc

      // i is consumed element if result(i) is used outside whileOp or
      // argument(i) is used in whileOp.getCond().
      for (auto i = 0; i < n; ++i) {
        if (!while_op.getResult(i).use_empty() ||
            !cond.getArgument(i).use_empty()) {
          explicitly_consumed_ids.push_back(i);
        }
      }
      // Empty consumed_element_ids implies none of results is used.
      if (explicitly_consumed_ids.empty()) {
        while_op.erase();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/transforms/modify_io_nodes.cc

            quantize_op.emitError(" Couldn't be modified to the requested type.");
            return failure();
          }
          new_input_types[i] = arg_type;
          arg.dropAllUses();
          if (quantize_op.use_empty()) {
            quantize_op.erase();
          }
        } else {
          // `arg` has multiple uses or the user isn't a quantiz op (so we couldn't
          // rewrite it to a different type. Make a copy of the `arg` and replace
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/transforms/tpu_partitioned_op_conversion.cc

          status = ReplacePartitionedOp(num_cores_per_replica, partitioned_output);
        }
    
        if (status.has_value()) {
          if (failed(*status) || !op->use_empty()) return WalkResult::interrupt();
    
          op->erase();
        }
    
        return WalkResult::advance();
      });
    
      if (result.wasInterrupted()) {
        signalPassFailure();
        return;
      }
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/optimize_global_tensors.cc

        llvm::BitVector args_to_erase(func.getNumArguments());
        for (int i = 0, e = func.getNumArguments(); i < e; i++) {
          if (func.getArgAttr(i, "tf_saved_model.bound_input") &&
              func.getArgument(i).use_empty()) {
            args_to_erase.set(i);
          }
        }
        func.eraseArguments(args_to_erase);
      }
    }
    
    void OptimizeGlobalTensorsPass::runOnOperation() {
      auto module = getOperation();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/tests/canonicalize.mlir

      // CHECK: return %0#1 : tensor<f32>
      func.return %0#1 : tensor<f32>
    }
    
    // -----
    
    // Test case to test bug due to checking
    // `while_op.getResult(arg_index).use_empty()` instead of
    // `while_op.getResult(while_index).use_empty()` in the tfl.while
    // canonicalization.
    // arg0 is a pass through. After first iteration, arg_index = 0
    // and while_index = 1. Make arg1 use empty in block and condition, but not in
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 02 09:41:17 UTC 2024
    - 20.6K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/transforms/optimize_functional_ops.cc

        func::FuncOp else_func = op.else_function();
    
        // If the If has no uses and its functions are side-effect free, then
        // remove.
        // TODO(jpienaar): Remove once recusive side-effects are supported.
        if (op.use_empty() &&
            (op.getIsStateless() ||
             (IsSideEffectFree(then_func) && IsSideEffectFree(else_func)))) {
          rewriter.eraseOp(op.getOperation());
          return success();
        }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tensorflow/transforms/readonly_references_to_resources.cc

      // directly.
      auto read_only_vars_fn = [&variable_v2s_to_replace](
                                   VariableV2Op variable_v2_op) {
        if (variable_v2_op.getResult().use_empty()) {
          // Erase the op when there is no user.
          variable_v2_op.erase();
          return mlir::WalkResult::advance();
        }
        if (!all_of(variable_v2_op.getResult().getUsers(), [&variable_v2_op](
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/transforms/prepare_tf.cc

          return failure();
    
        if (!(((*root.getODSResults(1).begin()).use_empty()))) {
          return rewriter.notifyMatchFailure(
              fused_batch_norm_op, [&](::mlir::Diagnostic &diag) {
                diag << "entities '' failed to satisfy constraint: has no use";
              });
        }
    
        if (!(((*root.getODSResults(2).begin()).use_empty()))) {
          return rewriter.notifyMatchFailure(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 21:49:50 UTC 2024
    - 64.6K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/experimental/tac/transforms/device_transform.cc

      LogicalResult matchAndRewrite(TFL::QuantizeOp quant_op,
                                    PatternRewriter& rewriter) const override {
        if (!quant_op.getResult().use_empty()) return failure();
    
        rewriter.eraseOp(quant_op);
        return success();
      }
    };
    
    void OptimizeQuantizedOpToFloat(func::FuncOp func, MLIRContext* context) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.4K bytes
    - Viewed (0)
Back to top