Disable memory sharing for GPU. (#21370)

This commit is contained in:
Anastasiia Pnevskaia 2023-11-30 12:05:25 +01:00 committed by GitHub
parent a9d2dd0b02
commit b0b28e3853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,6 +91,9 @@ class TFGraphNodeDecoder(DecoderBase):
if not self.m_inner_graph:
variable_value = TFGraphNodeDecoder.get_variable(self.m_operation)
if variable_value is not None:
# Disable sharing for variables which are not on CPU
if "device:CPU" not in variable_value.device:
self.m_shared_memory = False
# does not copy data
self.m_parsed_content = variable_value.__array__()