Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 92 for yield4x (0.25 sec)

  1. docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md

    在 `yield` 后抛出 `HTTPException` 或类似的异常是很诱人的,但是**这不起作用**。
    
    带有`yield`的依赖中的退出代码在响应发送之后执行,因此[异常处理程序](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}已经运行过。没有任何东西可以捕获退出代码(在`yield`之后)中的依赖抛出的异常。
    
    所以,如果在`yield`之后抛出`HTTPException`,默认(或任何自定义)异常处理程序捕获`HTTPException`并返回HTTP 400响应的机制将不再能够捕获该异常。
    
    这就是允许在依赖中设置的任何东西(例如数据库会话(DB session))可以被后台任务使用的原因。
    
    后台任务在响应发送之后运行。因此,无法触发`HTTPException`,因为甚至没有办法更改*已发送*的响应。
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  2. docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md

        **FastAPI** はこれを実現するために内部的に使用しています。
    
    ## `yield`と`HTTPException`を持つ依存関係
    
    `yield`と例外をキャッチする`try`ブロックを持つことができる依存関係を使用することができることがわかりました。
    
    `yield`の後の終了コードで`HTTPException`などを発生させたくなるかもしれません。しかし**それはうまくいきません**
    
    `yield`を持つ依存関係の終了コードは[例外ハンドラ](../handling-errors.md#_4){.internal-link target=_blank}の*後に*実行されます。依存関係によって投げられた例外を終了コード(`yield`の後)でキャッチするものはなにもありません。
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/ir/tf_executor.cc

      Operation &yield = island.GetBody().back();
      if (!isa<YieldOp>(yield))
        return yield.emitOpError()
               << "invalid tf_executor.island terminator, yield expected";
    
      // Ensure that the yield terminator operands matches the island results type.
      int result_count = island.getNumResults() - 1;  // -1 for the control token
      const int num_operands = yield.getNumOperands();
      if (num_operands != result_count)
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 42.7K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/transforms/executor_island_coarsening.cc

        // Add associated inner op result to operands of the YieldOp.
        yield_operands.push_back(old_result.inner_op_result);
      }
    
      // Create YieldOp for the new island.
      OpBuilder builder(&new_island.GetBody(), new_island.GetBody().end());
      return builder.create<YieldOp>(new_island.getLoc(), yield_operands);
    }
    
    // Moves inner ops (excluding last op/YieldOp) from islands being merged into
    // the new merged island.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 19.7K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/region_control_flow_to_functional.cc

      //   r0, r1, ..., rN = func.call @foo(arg0, arg1, ..., argN)
      //   "tf.yield"(r0, r1, ..., rN)
      if (!region.hasOneBlock()) return std::nullopt;
      Block& block = region.front();
      if (std::distance(block.begin(), block.end()) != 2) return std::nullopt;
      TF::YieldOp yield =
          llvm::dyn_cast_or_null<TF::YieldOp>(block.getTerminator());
      if (!yield) return std::nullopt;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 28.7K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/transforms/while_loop_outline.cc

    // to functions).
    bool IsAlreadyOutlined(WhileOp while_op) {
      auto just_call = [](Region& region) {
        auto it = region.front().begin();
        if (!isa<func::CallOp>(*it)) return false;
        ++it;
        if (!isa<YieldOp>(*it)) return false;
        return true;
      };
      return just_call(while_op.getBody()) && just_call(while_op.getCond());
    }
    
    bool IsCompatibleTypeWithTFLCastOp(Type type) {
      auto elemType = getElementTypeOrSelf(type);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/transforms/functional_control_flow_to_regions.cc

    // the call arguments, and terminate the region with a yield. The arguments are
    // cast to the required type before the call. `use_region_args` control whether
    // the input arguments are used as is (for IfOp) or block arguments of the same
    // type as the input arguments are created and then used as call arguments (for
    // While).
    YieldOp CreateCall(Operation* op, func::FuncOp func, Region& caller_region,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11K bytes
    - Viewed (0)
  8. cni/pkg/install/install.go

    	// at this moment, and if not, yield. This is to catch other CNIs which might have mutated the file between
    	// the (theoretical) window after we initially install/write, but before we actually start the filewatch.
    	if err := checkValidCNIConfig(in.cfg, in.cniConfigFilepath); err != nil {
    		return nil
    	}
    
    	// If a file we are watching has a change event, yield and let caller check validity
    	select {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 31 21:45:18 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  9. okhttp-testing-support/src/main/kotlin/okhttp3/internal/concurrent/TaskFaker.kt

     * Runs a [TaskRunner] in a controlled environment so that everything is sequential and
     * deterministic.
     *
     * This class ensures that at most one thread is running at a time. This is initially the JUnit test
     * thread, which yields its execution privilege while calling [runTasks], [runNextTask], or
     * [advanceUntil]. These functions don't return until the task threads are all idle.
     *
     * Task threads release their execution privilege in these ways:
     *
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Apr 29 00:33:04 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  10. src/iter/pull_test.go

    import (
    	"fmt"
    	. "iter"
    	"runtime"
    	"testing"
    )
    
    func count(n int) Seq[int] {
    	return func(yield func(int) bool) {
    		for i := range n {
    			if !yield(i) {
    				break
    			}
    		}
    	}
    }
    
    func squares(n int) Seq2[int, int64] {
    	return func(yield func(int, int64) bool) {
    		for i := range n {
    			if !yield(i, int64(i)*int64(i)) {
    				break
    			}
    		}
    	}
    }
    
    func TestPull(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 19:09:28 UTC 2024
    - 10.2K bytes
    - Viewed (0)
Back to top