Skip to content

Commit e0cd635

Browse files
committed
full_like to full decomposition moving to decomposition.py for dynamic case
1 parent b4de166 commit e0cd635

File tree

3 files changed

+12
-65
lines changed

3 files changed

+12
-65
lines changed

py/torch_tensorrt/dynamo/lowering/_decompositions.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,18 @@ def log_softmax_decomposition(
400400
)
401401

402402

403+
@register_torch_trt_decomposition(
404+
torch.ops.aten.full_like, registry=TORCH_TRT_DECOMPOSITIONS
405+
)
406+
def full_like_decomposition(*args, **kwargs) -> torch.Tensor:
407+
input = args[0]
408+
shape = args[0].shape
409+
fill_value = args[1]
410+
kwargs["dtype"] = input.dtype
411+
kwargs["device"] = to_torch_device(default_device())
412+
return torch.full(shape, fill_value, dtype=kwargs["dtype"], device=kwargs["device"])
413+
414+
403415
def get_decompositions(
404416
enable_experimental_decompositions: bool = False,
405417
) -> Dict[OpOverload, Callable[[Any], Any]]:

py/torch_tensorrt/dynamo/lowering/passes/_aten_lowering_pass.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from .remove_detach import remove_detach
1515
from .remove_input_alias_fixing_clones import remove_input_alias_fixing_clones
1616
from .repair_input_as_output import repair_input_as_output
17-
from .replace_full_like_with_full import replace_full_like_with_full
1817
from .replace_max_pool_with_indices import replace_max_pool_with_indices
1918
from .view_to_reshape import view_to_reshape
2019

@@ -27,7 +26,6 @@
2726
lower_linear,
2827
fuse_prims_broadcast,
2928
replace_max_pool_with_indices,
30-
replace_full_like_with_full,
3129
view_to_reshape,
3230
remove_assert_scalar,
3331
accumulate_fp32_matmul,

py/torch_tensorrt/dynamo/lowering/passes/replace_full_like_with_full.py

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)