Skip to content
Merged
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
12 changes: 6 additions & 6 deletions deepmd/infer/deep_pot.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,31 +114,32 @@ def __init__(
operations = [op.name for op in self.graph.get_operations()]
# check if the graph has these operations:
# if yes add them
if "t_efield" in operations:
self._get_tensor("t_efield:0", "t_efield")

if ("%s/t_efield" % load_prefix) in operations:
self.tensors.update({"t_efield": "t_efield:0"})
self.has_efield = True
else:
log.debug("Could not get tensor 't_efield:0'")
self.t_efield = None
self.has_efield = False

if "load/t_fparam" in operations:
if ("%s/t_fparam" % load_prefix) in operations:
self.tensors.update({"t_fparam": "t_fparam:0"})
self.has_fparam = True
else:
log.debug("Could not get tensor 't_fparam:0'")
self.t_fparam = None
self.has_fparam = False

if "load/t_aparam" in operations:
if ("%s/t_aparam" % load_prefix) in operations:
self.tensors.update({"t_aparam": "t_aparam:0"})
self.has_aparam = True
else:
log.debug("Could not get tensor 't_aparam:0'")
self.t_aparam = None
self.has_aparam = False

if "load/spin_attr/ntypes_spin" in operations:
if ("%s/spin_attr/ntypes_spin" % load_prefix) in operations:
self.tensors.update({"t_ntypes_spin": "spin_attr/ntypes_spin:0"})
self.has_spin = True
else:
Expand Down Expand Up @@ -399,7 +400,6 @@ def _prepare_feed_dict(
atom_types,
fparam=None,
aparam=None,
atomic=False,
efield=None,
mixed_type=False,
):
Expand Down