Files
ReAgent/reagent/test/models/test_utils.py
Pradeep Kumar Srinivasan 15ec3d92f1 Enable Pyre's source-db buck builder and auto-suppress errors - batch 8.
Reviewed By: grievejia

Differential Revision: D24655770

fbshipit-source-id: 1fec713e37a8edc4ef0a9855f55c52bcf28eb275
2020-11-09 14:56:16 -08:00

33 lines
695 B
Python

#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
import numpy.testing as npt
import torch
logger = logging.getLogger(__name__)
def check_save_load(
self,
model,
expected_num_params,
expected_num_inputs,
expected_num_outputs,
check_equality=True,
):
# TODO: remove the expected_num* from call sites
# TODO: revive this test or kill it
# input_prototype = model.input_prototype()
# traced_model = torch.jit.trace(model, input_prototype)
# if check_equality:
# x = model(*input_prototype)
# y = traced_model(*input_prototype)
# self.assertEqual(x, y)
pass