Device.close()

Info Value
Package mvnc
Module mvncapi
Version 2.0
See also Device, Device.open(), Device.destroy()

Overview

This method closes communication with a neural compute device that has been opened with Device.open(). Opened devices have an OPENED DeviceState.

Before calling this method, you should destroy all Fifos and Graphs that were allocated to this Device. This method should be called before calling Device.destroy() for an open device.

Syntax

device.close()

Parameters

None.

Return

None

Raises

Exception with a status code from Status if underlying function calls return a status other than Status.OK.

Notes

  • When the device has been successfully closed the DeviceState will be CLOSED.

Example

from mvnc import mvncapi

# Get a list of valid device identifiers
device_list = mvncapi.enumerate_devices()

# Create a Device instance for the first device found
device = mvncapi.Device(device_list[0])

# Open communication with the device
device.open()

#
# Use the device...
#

# Close the device and destroy the device handle
device.close()
device.destroy()