Merge pull request #37213 from jaketae:embed-pdf
PiperOrigin-RevId: 313434163 Change-Id: Ib895aea697e95809855b63742923088556f8f2d0
This commit is contained in:
commit
66a9ffbc72
@ -317,8 +317,9 @@ def plot_model(model,
|
|||||||
# Return the image as a Jupyter Image object, to be displayed in-line.
|
# Return the image as a Jupyter Image object, to be displayed in-line.
|
||||||
# Note that we cannot easily detect whether the code is running in a
|
# Note that we cannot easily detect whether the code is running in a
|
||||||
# notebook, and thus we always return the Image if Jupyter is available.
|
# notebook, and thus we always return the Image if Jupyter is available.
|
||||||
try:
|
if extension != 'pdf':
|
||||||
from IPython import display
|
try:
|
||||||
return display.Image(filename=to_file)
|
from IPython import display
|
||||||
except ImportError:
|
return display.Image(filename=to_file)
|
||||||
pass
|
except ImportError:
|
||||||
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user