Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for GetStableHloOpQuantSpec (0.29 sec)

  1. tensorflow/compiler/mlir/quantization/stablehlo/ops/stablehlo_op_quant_spec.h

    #include "tensorflow/compiler/mlir/quantization/tensorflow/quantization_options.pb.h"
    
    namespace mlir::quant::stablehlo {
    
    // Returns StableHLO quantization specs for an op.
    std::unique_ptr<OpQuantSpec> GetStableHloOpQuantSpec(Operation* op);
    
    // Returns quantization constraints (ex: fixed output, same scale) given
    // a StableHLO op.
    std::unique_ptr<OpQuantScaleSpec> GetStableHloQuantConstraints(Operation* op);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 03 05:11:03 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/stablehlo/ops/stablehlo_op_quant_spec_test.cc

          FindFirstOpFromMainFunc<TF::XlaCallModuleOp>(*module_op);
      ASSERT_TRUE(succeeded(xla_call_module_op));
    
      const std::unique_ptr<OpQuantSpec> op_quant_spec =
          GetStableHloOpQuantSpec(*xla_call_module_op);
      ASSERT_THAT(op_quant_spec, NotNull());
    
      EXPECT_THAT(op_quant_spec->coeff_op_quant_dim, IsEmpty());
    }
    
    TEST_F(GetStableHloOpQuantSpecTest,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 04 07:19:09 UTC 2024
    - 14.8K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/stablehlo/ops/stablehlo_op_quant_spec.cc

            spec.coeff_op_quant_dim[operand_idx] =
                quantized_type.dimension_specs().dimension();
          }
        }
      }
    }
    
    }  // namespace
    
    std::unique_ptr<OpQuantSpec> GetStableHloOpQuantSpec(Operation* op) {
      auto spec = std::make_unique<OpQuantSpec>();
      if (auto call_op = dyn_cast_or_null<TF::XlaCallModuleOp>(op)) {
        auto entry_function =
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 09 05:56:10 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/stablehlo/passes/prepare_quantize.cc

        return success();
      }
    };
    
    void PrepareQuantizePass::runOnOperation() {
      ModuleOp module_op = getOperation();
      MLIRContext* ctx = module_op.getContext();
    
      auto func_op_quant_spec = GetStableHloOpQuantSpec;
      auto func_op_quant_scale_spec = GetStableHloQuantConstraints;
    
      for (auto func_op : module_op.getOps<func::FuncOp>()) {
        // The function might contain more stats ops than required, and it will
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 03 05:11:03 UTC 2024
    - 8.1K bytes
    - Viewed (0)
Back to top