動態

詳情 返回 返回

【Triton 教程】triton_language.broadcast_to - 動態 詳情

Triton 是一種用於並行編程的語言和編譯器。它旨在提供一個基於 Python 的編程環境,以高效編寫自定義 DNN 計算內核,並能夠在現代 GPU 硬件上以最大吞吐量運行。

更多 Triton 中文文檔可訪問 →https://triton.hyper.ai/

triton.language.broadcast_to(input, *shape)

嘗試將給定的張量廣播到新的 shape

參數

  • input (Block) - 輸入張量。
  • shape - 所需的形狀。

shape 可以以 1 個元組或獨立參數被傳入:

# These are equivalent 
# 這些是等效的
broadcast_to(x, (32, 32))
broadcast_to(x, 32, 32)

該函數也可作為 tensor 的 1 個成員函數調用,使用 x.broadcast_to(...) 而不是 broadcast_to(x, ...)

user avatar huandanshendeshoushudao 頭像 aitinggedejinzhengu 頭像 u_16640205 頭像 yejianfeixue 頭像 haoqidedalianmao 頭像 huidadebianpao 頭像 huaiyue_63f0b9e085bf0 頭像 swiftcommunity 頭像 hunter_58d48c41761b8 頭像 alluxio_com 頭像 laoshidejiandao 頭像 chenzhuodeyagao 頭像
點贊 16 用戶, 點贊了這篇動態!
點贊

Add a new 評論

Some HTML is okay.