在沒有官方文檔的情況下,如何檢查Python package的特定function有哪些arguments?

# https://www.geeksforgeeks.org/how-to-get-list-of-parameters-name-from-a-function-in-python/import inspect
from pytorch_metric_learning import samplers
print(inspect.getargspec(samplers.MPerClassSampler))
# output
ArgSpec(args=[‘self’, ‘labels’, ‘m’, ‘length_before_new_iter’], varargs=None, keywords=None, defaults=(100000,))

--

--

Machine Learning | Deep Learning | https://linktr.ee/yanwei

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store