turn t With this function, you only need to write: @map_only(Tensor) def go(t): return ... You can also directly use 'tree_map_only' Ú