AtacWorks icon indicating copy to clipboard operation
AtacWorks copied to clipboard

Update metrics to support both numpy and torch tensor inputs

Open tijyojwad opened this issue 6 years ago • 3 comments

Convert inputs and inputs to torch tensors or numpy arrays before the call function based on whether the function uses scikit learn or torch functions for metric calculation

tijyojwad avatar Sep 03 '19 18:09 tijyojwad

@tijyojwad Is this still relevant? could you comment on what/how this PR is going to help with? Also, relevant files that need to be looked at for this change, if it needs to be addressed.

ntadimeti avatar Jun 01 '20 15:06 ntadimeti

This was intended for the metrics calculation classes. From what I recall there's a conditional in every metrics class that checks for whether or not the input array is numpy or a torch tensor. Python decorators are a neater way to do it so each of the classes can just call the decorator that does that check and conversion.

I think it's still relevant, but low priority.

tijyojwad avatar Jun 03 '20 13:06 tijyojwad

Gotcha! Makes sense.

ntadimeti avatar Jun 03 '20 13:06 ntadimeti