torch.Tensor.map_¶
- Tensor.map_(tensor, callable)¶
將
callable應用於self張量和給定tensor中的每個元素,並將結果儲存在self張量中。self張量和給定tensor必須是可廣播的 (broadcastable)。可呼叫物件 (
callable) 應該具有以下簽名:def callable(a, b) -> number
將 callable 應用於 self 張量和給定 tensor 中的每個元素,並將結果儲存在 self 張量中。self 張量和給定 tensor 必須是可廣播的 (broadcastable)。
可呼叫物件 (callable) 應該具有以下簽名:
def callable(a, b) -> number