File size: 488 Bytes
f670afc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Copyright (C) 2021 NVIDIA CORPORATION & AFFILIATES.  All rights reserved.
#
# This work is made available under the Nvidia Source Code License-NC.
# To view a copy of this license, check out LICENSE.md


def rename_inputs(cfg, is_inference, data):
    assert hasattr(cfg, 'rename_inputs')
    attr = getattr(cfg, 'rename_inputs')
    for key in attr.keys():
        value = attr[key]
        data[key] = data[value]
        # Delete the old key.
        del data[value]
    return data