Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 40 for getDefiningOp (0.16 sec)

  1. tensorflow/compiler/mlir/quantization/tensorflow/cc/constant_fold.cc

      SmallVector<ElementsAttr> inputs;
      for (auto operand : op->getOperands()) {
        auto preceding_const_op = operand.getDefiningOp<TF::ConstOp>();
        if (preceding_const_op) {
          inputs.push_back(preceding_const_op.getValue());
          continue;
        }
    
        Operation* preceding_op = operand.getDefiningOp();
        int preceding_result_id = -1;
        for (auto preceding_result : preceding_op->getResults()) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 5K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/stablehlo/transforms/composite_avg_pool_patterns.td

    
    // See the function doc in the header file.
    def GetPadOpType : NativeCodeCall<
      "GetPadOpType((*$0.begin()).getDefiningOp<mhlo::CompositeOp>())">;
    
    // See the function doc in the header file.
    def GetAvgPoolOpPadAttr: 
      NativeCodeCall<"GetAvgPoolOpPadAttr($_builder, (*$0.begin()).getDefiningOp<mhlo::CompositeOp>())">;
    
    // Returns true if the provided padding in the composite op can *not* be 
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 23:16:05 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/transforms/optimize_batch_matmul.cc

    bool NotFromDequant(mlir::Value value) {
      auto dequant_op = value.getDefiningOp<DequantizeOp>();
      if (dequant_op) {
        return false;
      }
      auto split_op = value.getDefiningOp<SplitOp>();
      if (!split_op) {
        return true;
      }
      return !split_op.getValue().getDefiningOp<DequantizeOp>();
    }
    
    // Optimize TFLite operations in functions.
    class OptimizeBatchMatmulPass
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/transforms/legalize_hashtables.cc

      LogicalResult matchAndRewrite(TF::LookupTableFindV2Op find_op,
                                    PatternRewriter& rewriter) const override {
        auto handle_op = find_op.getTableHandle().getDefiningOp();
        if (handle_op == nullptr) return failure();
        auto hashtable_op = llvm::dyn_cast<TFL::HashtableOp>(handle_op);
        if (hashtable_op == nullptr) return failure();
        rewriter.replaceOpWithNewOp<TFL::HashtableFindOp>(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/tensor_device_copy_conversion.cc

        // * the arg to the identity op is produced by a TPUExecuteOp.
        if (op_device && op_device.getValue().contains("TPU")) {
          return true;
        }
    
        Operation *def_op = arg.getDefiningOp();
        // If the arg to this identity op is the arg of a function, there's no
        // defining op.
        if (def_op != nullptr &&
            (isa<TF::TPUExecuteOp, TF::TPUExecuteAndUpdateVariablesOp>(def_op))) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/analysis/resource_dataflow.cc

          ResourceConstructingOps result(global_tensor);
          return result;
        }
      } else if (auto vh = dyn_cast<TF::VarHandleOp>(value.getDefiningOp())) {
        return ResourceConstructingOps(vh);
      } else if (auto it = dyn_cast<TF::IteratorOp>(value.getDefiningOp())) {
        return ResourceConstructingOps(it);
      }
      return ResourceConstructingOps();
    }
    
    ResourceConstructingOps ResourceConstructingOps::join(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/transforms/lower_globals_to_ml_program.cc

      }
    
      if (v.getDefiningOp()->getNumOperands() == 1) {
        // If the value is originating from an unary op, assume it's something
        // simple like "cast" and keep tracing.
        return traceUpwardsToArgument(v.getDefiningOp()->getOperand(0), seen, out);
      } else {
        // Typically a tf.VarHandle op.
        return v.getDefiningOp()->emitOpError("Non constant predecessor");
      }
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.6K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/stablehlo/odml_converter/folders.cc

      static std::optional<FoldAdaptor> Create(Operation* operation) {
        auto foldable_opr = [](Value val) -> bool {
          return !llvm::isa<BlockArgument>(val) &&
                 llvm::isa<stablehlo::ConstantOp>(val.getDefiningOp());
        };
        if (!llvm::all_of(operation->getOperands(), foldable_opr)) {
          return std::nullopt;
        }
        return FoldAdaptor(operation);
      }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 06:11:55 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/stablehlo/odml_converter/transforms/shlo_simplify.td

    def CloneF32ElementsAttrWithOnes
      : NativeCodeCall<"DenseElementsAttr::get($0.getType().cast<ShapedType>(), (float)1.0)">;
    
    def NotConstant : Constraint<
        CPred<"$0.isa<BlockArgument>() || !llvm::isa<stablehlo::ConstantOp>($0.getDefiningOp())">,
        "Is not a constant.">;
    
    def : Pat<(StableHLO_DivOp $l,
                (StableHLO_ConstantOp:$divisor FloatElementsAttr<32>:$cst)),
              (StableHLO_MulOp $l,
                (StableHLO_DivOp
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 10 03:05:20 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_driver_test.cc

      Operation* xla_call_module_op =
          FindOperationOfType<TF::XlaCallModuleOp>(main_fn);
      Operation* filter_dcast_op =
          xla_call_module_op->getOperand(1).getDefiningOp();
      Operation* filter_qcast_op = filter_dcast_op->getOperand(0).getDefiningOp();
      ASSERT_NE(filter_qcast_op, nullptr);
      EXPECT_TRUE(isa<quantfork::QuantizeCastOp>(filter_qcast_op));
      EXPECT_TRUE(isa<quantfork::DequantizeCastOp>(filter_dcast_op));
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 7.9K bytes
    - Viewed (0)
Back to top