Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 64 for CastOp (0.11 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. tensorflow/compiler/mlir/tensorflow/transforms/collection_ops_util.cc

        buffer_shape.push_back(dim);
      }
      auto zero = CreateScalarConst(0, builder, op->getLoc());
      if (getElementTypeOrSelf(zero.getType()) != element_dtype) {
        zero = builder.create<TF::CastOp>(
            op->getLoc(),
            ArrayRef<Type>{tensorflow::GetTypeFromTFTensorShape({}, element_dtype)},
            ArrayRef<Value>{zero});
      }
      auto buffer_type =
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/transforms/legalize_tf.cc

        ShapedType new_type =
            RankedTensorType::get(shaped_type.getShape(), new_ele_type);
        return rewriter.createOrFold<TF::CastOp>(loc, new_type, val,
                                                 rewriter.getBoolAttr(false));
      }
      return rewriter.createOrFold<TF::CastOp>(
          loc, UnrankedTensorType::get(new_ele_type), val,
          rewriter.getBoolAttr(false));
    }
    
    // Utility function to-
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon May 20 20:06:54 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tensorflow/transforms/resource_op_lifting_cleanup.cc

      return mlir::isa<TF::ResourceType>(getElementTypeOrSelf(value.getType()));
    }
    
    // Checks if a cast op is casting a resource -> resource.
    bool IsCastOfResource(Operation &op) {
      auto cast = dyn_cast<TF::CastOp>(op);
      if (!cast) return false;
      return IsResource(cast.getX());
    }
    
    // Removes passthrough ops in the block. The device computation does not need
    // such nodes to carry information.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 19.7K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tf2xla/transforms/legalization_op_config.cc

            // CaseOp isn't actually supported but is enabled for testing to
            // make sure ops with symbol ref attributes are filtered out.
            TypeID::get<TF::CaseOp>(),
            TypeID::get<TF::CastOp>(),
            TypeID::get<TF::ClipByValueOp>(),
            TypeID::get<TF::CholeskyOp>(),
            TypeID::get<TF::CollectiveReduceV2Op>(),
            TypeID::get<TF::ComplexAbsOp>(),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 24 04:08:35 UTC 2024
    - 21.7K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_hlo.cc

            RankedTensorType::get(transpose_params.canonicalized_output_shape,
                                  result_type.getElementType());
    
        TF::CastOp cast_op = nullptr;
        if (start_indices_type.getElementType().isUnsignedInteger(32)) {
          cast_op = rewriter.create<TF::CastOp>(
              gather_op->getLoc(),
              RankedTensorType::get(start_indices_type.getShape(),
                                    rewriter.getI64Type()),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 154.9K bytes
    - Viewed (0)
Back to top