Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 40 for constant_ops (0.18 sec)

  1. tensorflow/c/experimental/saved_model/core/revived_types/constant.h

    // the python's eager mode logic, we bypass calling the "Const" op:
    // https://github.com/tensorflow/tensorflow/blob/1c064ab76064c58e54261b805027474885a1534d/tensorflow/python/framework/constant_op.py#L301
    class Constant : public TensorHandleConvertible {
     public:
      static Status Create(ImmediateExecutionContext* ctx,
                           AbstractTensorInterface* tensor,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Aug 30 19:43:25 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/experimental/tac/common/utils.h

    namespace TFL {
    namespace tac {
    
    // Returns true if 'op' is non const op. Returns false otherwise or if
    // 'op' is null.
    inline bool IsNonConstOp(Operation* op) {
      if (!op) return false;
      if (llvm::isa<arith::ConstantOp, mlir::func::ConstantOp>(op)) return false;
      if (op->hasTrait<OpTrait::ConstantLike>()) return false;
      if (llvm::isa<TFL::ConstOp, TFL::QConstOp>(op)) return false;
      return true;
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/quantization/lite/tfl_to_std.cc

          q.erase();
        } else if (auto q = llvm::dyn_cast<ConstOp>(op)) {
          auto value = q.getValue();
          auto type = q.getResult().getType();
          if (arith::ConstantOp::isBuildableWith(value, type)) {
            auto c = b.create<arith::ConstantOp>(q.getLoc(), q.getValue());
            q.getOutput().replaceAllUsesWith(c);
            q.erase();
          } else if (TFL::NoValueOp::isBuildableWith(value, type)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 22 02:50:01 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/stablehlo/transforms/tflite_legalize_hlo.cc

      PopulateLegalizeHloToTFLitePatterns(&patterns, &context);
    
      ConversionTarget target(context);
      target.addLegalDialect<TFL::TensorFlowLiteDialect, mhlo::MhloDialect>();
      target.addLegalOp<func::CallOp, func::ConstantOp, arith::ConstantOp>();
      target.addDynamicallyLegalOp<mhlo::CustomCallOp>(IsCustomCallLegal);
      target.addDynamicallyLegalOp<mhlo::ReduceOp>(IsReduceOpLegal);
      // Converted MHLO ops should be marked illegal here.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  5. 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)
  6. tensorflow/compiler/mlir/tensorflow/transforms/init_text_file_to_import.cc

        Value key_constant_tensor = rewriter.create<arith::ConstantOp>(
            op.getLoc(),
            DenseStringElementsAttr::get(
                RankedTensorType::get(static_cast<int64_t>(lines.size()),
                                      StringType::get(rewriter.getContext())),
                lines));
    
        Value value_constant_tensor = rewriter.create<arith::ConstantOp>(
            op.getLoc(), rewriter.getI64TensorAttr(line_nums));
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Nov 03 12:35:38 UTC 2022
    - 6.1K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/quantization/stablehlo/ops/stablehlo_op_quant_spec.cc

        scale_spec->has_same_operand_and_result_type_requirement = true;
      }
      return scale_spec;
    }
    
    bool IsOpQuantizableStableHlo(Operation* op) {
      if (isa<func::ConstantOp, mlir::stablehlo::ConstantOp>(op)) {
        // Constant ops do not have QuantizableResult attribute but can be
        // quantized.
        return true;
      } else if (op->hasTrait<OpTrait::IsTerminator>() ||
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 09 05:56:10 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/stablehlo/passes/convert_func_to_bfloat16.cc

          if (failed(rewriter.convertRegionTypes(&new_region, *getTypeConverter())))
            return failure();
        }
    
        // Convert value of ConstantOp to bfloat16.
        if (auto const_op = dyn_cast<mlir::stablehlo::ConstantOp>(op)) {
          const auto values = const_op.getValue().tryGetValues<float>();
          if (!values.has_value()) {
            return failure();
          }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/transforms/device_index_selector.cc

          if (!isa<TF::CaseOp>(use)) return;
        }
        DenseElementsAttr attr =
            DenseElementsAttr::get(type, b.getI32IntegerAttr(index));
        auto constant = b.create<arith::ConstantOp>(op.getLoc(), type, attr);
        op.replaceAllUsesWith(constant.getOperation());
        op.erase();
      });
    }
    
    // Creates an instance of the TensorFlow DeviceIndex selector pass.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Nov 03 12:35:38 UTC 2022
    - 3.4K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/transforms/legalize_jax_random.cc

        result_shape_i32.push_back(static_cast<int32_t>(element));
      }
      auto result_shape_attr = builder.getI32TensorAttr(result_shape_i32);
      Value result_shape_tensor =
          builder.create<stablehlo::ConstantOp>(result_shape_attr);
      auto custom_code =
          IsJaxRandomUniform(func) ? "RandomUniform" : "RandomStandardNormal";
    
      llvm::SmallVector<Type> result_ty_vec({result_ty});
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.1K bytes
    - Viewed (0)
Back to top