Thank you for your explanation, I still not fully understand and have some questions.
-
As for the below example, the strategy means the topi and the schedule, did I understand wrong? In your opinion, topi includes schedules, I’m very confused about the concepts.
@override_native_generic_func(“cumsum_strategy”)
def cumsum_strategy(attrs, inputs, out_type, target):
"""cumsum generic strategy""" strategy = _op.OpStrategy() strategy.add_implementation( wrap_compute_scanop(topi.cumsum), wrap_topi_schedule(topi.generic.schedule_extern), name="cumsum.generic", ) return strategy -
There is another example.
@reg.register_compute(“image.resize2d”)
def compute_resize2d(attrs, inputs, out_type):
"""compute definition for resize2d op"""
size = attrs.size
layout = attrs.layout
method = attrs.method
coord_trans = attrs.coordinate_transformation_mode
rounding_method = attrs.rounding_method
cubic_alpha = attrs.cubic_alpha
cubic_exclude = attrs.cubic_exclude
out_dtype = attrs.out_dtype
return [
topi.image.resize2d(
inputs[0],
size,
layout,
method,
coord_trans,
rounding_method,
cubic_alpha,
cubic_exclude,
out_dtype,
)
]
reg.register_injective_schedule(“image.resize2d”)
I think the two examples both arranges the topi and schedule. Please forgive me for my ignorance.