Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 55 for getDefiningOp (0.29 sec)

  1. tensorflow/compiler/mlir/lite/transforms/default_quant_params.cc

      // This value isn't an expressed type (float), skip.
      if (!new_type) return;
    
      Block &block = value.getParentRegion()->front();
      Operation *op = value.getDefiningOp();
      if (op) {
        builder.setInsertionPoint(&block, ++Block::iterator(op));
      } else {
        builder.setInsertionPointToStart(&block);
      }
      TypeAttr type_attr = TypeAttr::get(new_type);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/tensorflow/transforms/remove_vars_in_session_initializer.cc

        }
      }
    
      erase_list.push_back(op);
    
      for (auto& use : op->getOpOperands()) {
        if (auto op_result = mlir::dyn_cast<mlir::OpResult>(use.get())) {
          Operation* def = op_result.getDefiningOp();
          if (!dead_ops.insert(def).second) continue;
          RecursiveRemove(def, erase_list, dead_ops);
        }
      }
    }
    
    void RemoveVariables(llvm::ArrayRef<VarHandleOp> vars) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/transforms/annotate_parameter_replication.cc

    };
    
    // Returns the first value in the chain of operands, which is not defined by a
    // tf.IdentityOp or a tf.ReadVariableOp.
    Value SkipIdentityAndReadVariable(Value v) {
      while (auto op = v.getDefiningOp()) {
        if (!isa<TF::IdentityOp, TF::ReadVariableOp>(op)) break;
        v = op->getOperand(0);
      }
      return v;
    }
    
    void AnnotateParameterReplicationPass::runOnOperation() {
      ModuleOp m = getOperation();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/transforms/reduce_type_precision.cc

            !result_type || !result_type.getElementType().isSignlessInteger(8)) {
          return failure();
        }
    
        auto input_op =
            dyn_cast<arith::ConstantOp>(op.getOperand(0).getDefiningOp());
        if (!input_op) {
          return failure();
        }
    
        Builder builder(op.getContext());
        auto new_gather_op = rewriter.create<TFL::GatherOp>(
            op.getLoc(),
            /*result=*/
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/quantization/ir/ConvertConst.cc

      }
    
      // When creating the new const op, use a fused location that combines the
      // original const and the qbarrier that led to the quantization.
      auto fusedLoc = rewriter.getFusedLoc(
          {qbarrier.getArg().getDefiningOp()->getLoc(), qbarrier.getLoc()});
      auto newConstOp = rewriter.create<arith::ConstantOp>(
          fusedLoc, newConstValueType, cast<TypedAttr>(newConstValue));
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/transforms/tpu_host_computation_expansion.cc

    // returns the owner of the Block.
    Operation* GetOpOfValue(Value value) {
      if (auto block_arg = mlir::dyn_cast<BlockArgument>(value))
        return block_arg.getOwner()->getParentOp();
    
      return value.getDefiningOp();
    }
    
    // TODO(b/158596585): Replace this with a cost model analysis.
    bool IsTrivialUnaryOperation(Operation* op) {
      return llvm::isa<TF::CastOp, TF::IdentityOp>(op);
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/transforms/localize_var_handles.cc

        resource = write.getResource();
      } else if (auto next = llvm::dyn_cast<TF::IteratorGetNextOp>(op)) {
        resource = next.getIterator();
      }
    
      if (llvm::dyn_cast_or_null<TF::VarHandleOp>(resource.getDefiningOp())) {
        return;  // We're already directly after a VarHandleOp.
      }
    
      const TF::ResourceDataflowState* state =
          solver.lookupState<TF::ResourceDataflowState>(resource);
      if (!state) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Mar 06 23:53:00 UTC 2024
    - 5K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/stablehlo/passes/convert_xla_call_module_op_to_bfloat16.cc

            op_result.setType(ToBfloat16Type(original_type));
            const Value cast =
                builder.create<TF::CastOp>(op->getLoc(), original_type, op_result);
            op_result.replaceAllUsesExcept(cast, cast.getDefiningOp());
          }
        }
        return WalkResult::advance();
      });
    
      if (result.wasInterrupted()) return signalPassFailure();
    }
    
    }  // namespace
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 05 08:32:43 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/transforms/tpu_resource_read_for_write.cc

        if (handle_user == assign_var) continue;
        auto assign_var_user = dyn_cast<TF::AssignVariableOp>(handle_user);
        if (!assign_var_user) continue;
        if (assign_var_user.getValue().getDefiningOp() == cluster_func)
          return resource;
      }
    
      resource.resource = assign_var.getResource();
      resource.subtype = assign_var.getValue().getType();
      return resource;
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 02 16:54:40 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/transforms/hoist_loop_invariant.cc

      // hoisted.
      auto read_var_op = llvm::dyn_cast<ReadVariableOp>(op);
      if (!read_var_op) return false;
      auto var_handle_op = llvm::dyn_cast_or_null<VarHandleOp>(
          read_var_op.getResource().getDefiningOp());
      if (!var_handle_op) return false;
      return read_only_vars.contains(GetResourceHandle(var_handle_op));
    }
    
    bool ShouldMoveOutOfRegion(
        Operation *op, Region *region,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.3K bytes
    - Viewed (0)
Back to top