Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 54 for CastOp (0.1 sec)

  1. tensorflow/compiler/mlir/quantization/tensorflow/ops/tf_op_quant_spec.cc

    bool IsOpWithDataMovementTrait(Operation* op) {
      // Supported data movement ops. These ops do not perform any computations and
      // has one result operand.
      return isa<TF::IdentityOp, TF::CastOp, TF::ReshapeOp, TF::XlaShardingOp,
                 TF::GatherOp, TF::GatherV2Op, TF::XlaGatherOp, TF::ExpandDimsOp,
                 TF::SqueezeOp, TF::TransposeOp>(op);
    }
    
    bool IsOpWithQuantizableTrait(Operation* op) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/tensorflow/transforms/region_control_flow_to_functional.cc

        if (std::get<0>(res_it) != std::get<1>(res_it)) return std::nullopt;
    
      // There can only be non-truncating cast op's prior to the call.
      for (; it != block.rend(); ++it) {
        CastOp cast = dyn_cast<CastOp>(*it);
        if (!cast || cast.getTruncate()) return std::nullopt;
      }
    
      return call;
    }
    
    using ArgMatcherFn = function_ref<bool(Value, Region&, Value, Region&)>;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 28.7K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/transforms/decompose_optionals.cc

        if (isa<TF::VariantType>(elementType)) {
          // We can only replace OptionalGetValue after the inputs have been
          // replaced.
          return failure();
        }
        rewriter.replaceOpWithNewOp<TF::CastOp>(op, op.getResult(0).getType(),
                                                input);
        return success();
      }
    };
    
    class HandleOptionalNone : public OpRewritePattern<TF::OptionalNoneOp> {
     public:
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jun 12 21:18:05 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/tensorflow/passes/quantize.cc

          return failure();
        }
    
        // Cast to float type before the AvgPool op.
        OpBuilder::InsertionGuard g(rewriter);
        rewriter.setInsertionPointAfter(preceding_sc_op);
        auto fcast_op = rewriter.create<TF::CastOp>(
            preceding_sc_op->getLoc(), dq_arg_type.clone(rewriter.getF32Type()),
            preceding_sc_op.getResult());
    
        // Create a new AvgPool op with float type.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Mar 22 05:52:39 UTC 2024
    - 23.6K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/functional_control_flow_to_regions.cc

        Value arg = std::get<0>(ArgAndType);
        Type expected_type = std::get<1>(ArgAndType);
        if (arg.getType() != expected_type) {
          arg = builder.create<CastOp>(loc, expected_type, arg,
                                       /*Truncate=*/builder.getBoolAttr(false));
        }
        casted_args.push_back(arg);
      }
      auto call = builder.create<func::CallOp>(loc, func, casted_args);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tf2xla/transforms/legalize_tf_with_tf2xla.cc

      // fallback legalization.
      auto cast_value = [&](OpBuilder& builder, Type result_type, ValueRange inputs,
                            Location loc) -> Value {
        return builder.create<mlir::tensor::CastOp>(loc, result_type,
                                                    inputs.front());
      };
      addSourceMaterialization(cast_value);
    }
    
    void PopulateLegalizeTfWithTf2XlaPatterns(llvm::StringRef device_type,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 21:49:50 UTC 2024
    - 9.7K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_tf_xla_call_module_to_stablehlo_pass.cc

          Value operand = std::get<0>(operand_and_type);
          Type expected_type = std::get<1>(operand_and_type);
          if (operand.getType() != expected_type) {
            operand = rewriter.create<TF::CastOp>(
                op.getLoc(), expected_type, operand,
                /*Truncate=*/rewriter.getBoolAttr(false));
          }
          casted_operands.push_back(operand);
        }
    
        auto call = rewriter.create<func::CallOp>(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jan 25 09:43:18 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tf2xla/internal/passes/tpu_sharding_identification_pass.cc

              next_values_to_visit.push_back(
                  while_op.getBody().front().getArgument(operand_number));
              continue;
            }
    
            if (llvm::isa<mlir::TF::IdentityOp, mlir::TF::CastOp,
                          mlir::TF::ReadVariableOp>(owner)) {
              next_values_to_visit.push_back(use.getOwner()->getResult(0));
              continue;
            }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 30 02:01:13 UTC 2024
    - 28.9K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/transforms/shape_inference.cc

      while (!worklist.empty()) {
        mlir::Operation* const use = worklist.pop_back_val();
    
        // Follow the `CastOp`/`IdentityOp`'s users to handle the `RestoreV2` ->
        // (optionally `IdentityOp`) -> `CastOp` `AssignVariableOp` case.
        if (llvm::isa<TF::CastOp, TF::IdentityOp>(use)) {
          llvm::append_range(worklist, use->getUsers());
          continue;
        }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Jun 08 07:28:49 UTC 2024
    - 134.1K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/ir/tf_ops.cc

                                           Location conversion_loc) const final {
        if (!mlir::isa<TensorType>(result_type) ||
            !mlir::isa<TensorType>(input.getType()))
          return nullptr;
        return builder.create<TF::CastOp>(conversion_loc, result_type, input,
                                          /*truncate=*/builder.getBoolAttr(false));
      }
    
      void processInlinedCallBlocks(
          Operation *call,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 14.6K bytes
    - Viewed (0)
Back to top