Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Intel MKL] expose inter/intra op config #898

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/validate_on_lfw.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
def main(args):

with tf.Graph().as_default():
config = tf.ConfigProto(inter_op_parallelism_threads=args.num_inter_threads,
intra_op_parallelism_threads=args.num_intra_threads)

with tf.Session() as sess:
with tf.Session(config = config) as sess:

# Read the file containing the pairs used for testing
pairs = lfw.read_pairs(os.path.expanduser(args.lfw_pairs))
Expand Down Expand Up @@ -158,6 +160,10 @@ def parse_arguments(argv):
help='Subtract feature mean before calculating distance.', action='store_true')
parser.add_argument('--use_fixed_image_standardization',
help='Performs fixed standardization of images.', action='store_true')
parser.add_argument('--num_inter_threads', type=int,
help='Number of inter op threads', default=0)
parser.add_argument('--num_intra_threads', type=int,
help='Number of intra op thread pool', default=0)
return parser.parse_args(argv)

if __name__ == '__main__':
Expand Down