NVIDIA / TensorRT-Incubator

Experimental projects related to TensorRT
81 stars 12 forks source link

Fix or remove `skip_num_stack_entries` in `convert_to_tensors` #310

Open pranavm-nvidia opened 3 weeks ago

pranavm-nvidia commented 3 weeks ago

When skip_num_stack_entries is set, the AST that we parse doesn't necessarily match the signature of the function that is actually being decorated. This can cause bugs because the arguments that we expect to see aren't the ones that we actually see.

skip_num_stack_entries is mainly used in cases where we want to process the argument before it has been converted to a tensor/shape, and we can do this through the preprocess_args option in the decorator. In slice, we use it to get stack information for the individual slice index arguments, but we could perhaps do that manually.

slyubomirsky commented 3 weeks ago

slice is the only use of it, so handling that separately might be the right way to go. I will see how feasible that would be.