MCPcopy Create free account
hub / github.com/pytorch/pytorch / componentDidMount

Method componentDidMount

torch/utils/model_dump/code.js:630–646  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

628 }
629
630 componentDidMount() {
631 const app = this;
632 if (BURNED_IN_MODEL_INFO !== null) {
633 app.setState({model: BURNED_IN_MODEL_INFO});
634 } else {
635 fetch("./model_info.json").then(function(response) {
636 if (!response.ok) {
637 throw new Error("Response not ok.");
638 }
639 return response.json();
640 }).then(function(body) {
641 app.setState({model: body});
642 }).catch(function(error) {
643 console.log("Top-level error: ", error);
644 });
645 }
646 }
647
648 componentDidCatch(error) {
649 void(error);

Callers

nothing calls this directly

Calls 3

fetchFunction · 0.85
thenMethod · 0.80
logMethod · 0.45

Tested by

no test coverage detected