Shamane Siriwardhana
Shamane Siriwardhana

Reputation: 4201

How can I know the location of a python function that imported from a library

from cs231n.fast_layers import conv_forward_fast, conv_backward_fast

out_fast, cache_fast = conv_forward_fast(x, w, b, conv_param)

How can I find the location of the conv_forward_fast function with a command?

Upvotes: 1

Views: 178

Answers (2)

Aaron
Aaron

Reputation: 2393

You can just

import cs231n.fast_layers as path
print(path)

and it will show you the path of the library.

Upvotes: 2

Łukasz Rogalski
Łukasz Rogalski

Reputation: 23203

In Python 2.x:

from os.path import join
path_to_module = __import__(join.__module__).__file__

Upvotes: 0

Related Questions